Package ptolemy.data.ontologies
Class InfiniteConcept
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.data.ontologies.Concept
-
- ptolemy.data.ontologies.InfiniteConcept
-
- All Implemented Interfaces:
java.lang.Cloneable
,InequalityTerm
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
FlatTokenInfiniteConcept
,MapTypeInfiniteConcept
public abstract class InfiniteConcept extends Concept
A concept that is not part of a finite ontology. This class represents Concepts that, rather than being drawn from a fixed finite set of the elements in a ConceptGraph, are drawn from a potentially infinite set, such as those used to represent structured datatypes like records, concepts parameterized over values, and other situations where enumerating all possible concepts beforehand is not feasible.Since this class aims to be a general superclass of any type of infinite concept, it does not provide any implementations that may be particular to a particular style of infinite concepts, and is abstract. Subclasses are responsible for determining exactly what type of infinite concept they will support.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ben Lickly
- Pt.AcceptedRating:
- Red (blickly)
- Pt.ProposedRating:
- Red (blickly)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.Concept
isAcceptable
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
InfiniteConcept(Ontology ontology)
Create a new Infinite concept, belonging to the given ontology, with an automatically generated name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
compare(Concept concept)
Compare this concept with the given concept.boolean
equals(java.lang.Object concept)
Return if this concept is equal to the given object, which is only the case if compare returns CPO.SAME.InfiniteConceptRepresentative
getRepresentative()
Return the finite concept representative in the ontology if it exists, or null if it does not.abstract Concept
greatestLowerBound(Concept concept)
Compute the greatest lower bound (GLB) of this and another concept.abstract int
hashCode()
Return a hash code for this Concept.abstract Concept
leastUpperBound(Concept concept)
Compute the least upper bound (LUB) of this and another concept.-
Methods inherited from class ptolemy.data.ontologies.Concept
getAssociatedObject, getColor, getOntology, getValue, getVariables, initialize, isAboveOrEqualTo, isSettable, isValueAcceptable, setValue, toString
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setContainer, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, connectionsChanged, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, validateSettables, workspace
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getDisplayName, getFullName, getName, getName
-
-
-
-
Constructor Detail
-
InfiniteConcept
protected InfiniteConcept(Ontology ontology) throws IllegalActionException, NameDuplicationException
Create a new Infinite concept, belonging to the given ontology, with an automatically generated name.- Parameters:
ontology
- The finite ontology to which this belongs.- Throws:
NameDuplicationException
- Not thrown.IllegalActionException
- If the base class throws it.
-
-
Method Detail
-
compare
public abstract int compare(Concept concept) throws IllegalActionException
Compare this concept with the given concept. Returns an int value that corresponds to the ordering between the elements as given in the CPO interface.- Parameters:
concept
- The concept with which we are comparing.- Returns:
- CPO.HIGHER if this concept is above the given concept, CPO.LOWER if this concept is below the given concept, CPO.SAME if both concepts are the same, and CPO.INCOMPARABLE if concepts are incomparable.
- Throws:
IllegalActionException
- If the specified concept does not have the same ontology as this one.
-
equals
public boolean equals(java.lang.Object concept)
Return if this concept is equal to the given object, which is only the case if compare returns CPO.SAME.- Overrides:
equals
in classjava.lang.Object
- Parameters:
concept
- Object with which to compare.- Returns:
- True, if both concepts are the same. False, otherwise.
-
getRepresentative
public InfiniteConceptRepresentative getRepresentative()
Return the finite concept representative in the ontology if it exists, or null if it does not. Derived classes only need to override this method if they have a representative in the ontology. Some infinite concepts likeRecordConcept
do not need a representative.- Returns:
- Return null in the base class.
-
hashCode
public abstract int hashCode()
Return a hash code for this Concept.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A valid hash code.
- See Also:
Object.hashCode()
-
greatestLowerBound
public abstract Concept greatestLowerBound(Concept concept) throws java.lang.IllegalArgumentException
Compute the greatest lower bound (GLB) of this and another concept.- Parameters:
concept
- The other concept- Returns:
- The concept that is the GLB of this and the given concept.
- Throws:
java.lang.IllegalArgumentException
- If concepts are not drawn from the same ontology.
-
leastUpperBound
public abstract Concept leastUpperBound(Concept concept) throws java.lang.IllegalArgumentException
Compute the least upper bound (LUB) of this and another concept.- Parameters:
concept
- The other concept- Returns:
- The concept that is the LUB of this and the given concept.
- Throws:
java.lang.IllegalArgumentException
- If concepts are not drawn from the same ontology.
-
-