Package ptolemy.data.ontologies
Class Concept
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.data.ontologies.Concept
-
- All Implemented Interfaces:
java.lang.Cloneable
,InequalityTerm
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
FiniteConcept
,InfiniteConcept
public abstract class Concept extends ComponentEntity implements InequalityTerm
A concept represents a single piece of information in an ontology. An instance of this class is always associated with a particular ontology, which is specified in the constructor.Note that this is an abstract class. Any concrete instance must be either a FiniteConcept or an InfiniteConcept.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ben Lickly, Edward A. Lee, Dai Bui, Christopher Brooks
- See Also:
Ontology
,ConceptGraph
- 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 Modifier and Type Field Description Parameter
isAcceptable
A parameter indicating whether this concept is an acceptable outcome during inference.-
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 Constructor Description Concept(CompositeEntity ontology, java.lang.String name)
Create a new concept with the specified name and the specified ontology.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAssociatedObject()
Return the associated object of this InequalityTerm, which is always null for concepts.ColorAttribute
getColor()
Return the color attribute associated with this Concept, if it exists.Ontology
getOntology()
Return the ontology that contains this concept.java.lang.Object
getValue()
Return the current value of the InequalityTerm.InequalityTerm[]
getVariables()
Return an array of variables contained in this InequalityTerm, or in this case, an empty array.void
initialize(java.lang.Object object)
Try to initialize the InequalityTerm, or in this case, throw an exception.boolean
isAboveOrEqualTo(Concept concept)
Return true if this concept is greater than or equal to the specified concept in the partial ordering.boolean
isSettable()
Return whether or not this InequalityTerm is settable.boolean
isValueAcceptable()
Return whether this concept is a valid inference result.void
setValue(java.lang.Object value)
Try to set the value of this InequalityTerm, or in this case, just throw an exception.abstract java.lang.String
toString()
Return the (unique) string representation of this concept.-
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
equals, finalize, getClass, hashCode, 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
-
-
-
-
Field Detail
-
isAcceptable
public Parameter isAcceptable
A parameter indicating whether this concept is an acceptable outcome during inference. This is a boolean that defaults to true.
-
-
Constructor Detail
-
Concept
public Concept(CompositeEntity ontology, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create a new concept with the specified name and the specified ontology.- Parameters:
ontology
- The specified ontology where this concept resides.name
- The specified name for the concept.- Throws:
NameDuplicationException
- If the ontology already contains a concept with the specified name.IllegalActionException
- If the base class throws it.
-
-
Method Detail
-
getAssociatedObject
public final java.lang.Object getAssociatedObject()
Return the associated object of this InequalityTerm, which is always null for concepts. For variable InequalityTerms, this method will return a reference to the model object associated with that InequalityTerm. For concepts, there is no associated model object, hence returning null is the right thing to do.- Specified by:
getAssociatedObject
in interfaceInequalityTerm
- Returns:
- Null, since concepts have no associated objects.
-
getColor
public ColorAttribute getColor() throws IllegalActionException
Return the color attribute associated with this Concept, if it exists.- Returns:
- The first ColorAttribute associated with this concept, if there is one. Null, otherwise.
- Throws:
IllegalActionException
- Not thrown in the base Concept class.
-
getOntology
public Ontology getOntology()
Return the ontology that contains this concept.- Returns:
- The containing ontology.
-
getValue
public final java.lang.Object getValue()
Return the current value of the InequalityTerm. Since a concept is a constant, not a variable, its value is just itself.- Specified by:
getValue
in interfaceInequalityTerm
- Returns:
- This concept.
- See Also:
setValue(java.lang.Object)
-
getVariables
public final InequalityTerm[] getVariables()
Return an array of variables contained in this InequalityTerm, or in this case, an empty array. A concept is a single constant, so it has no variables.- Specified by:
getVariables
in interfaceInequalityTerm
- Returns:
- An empty array.
-
initialize
public final void initialize(java.lang.Object object) throws IllegalActionException
Try to initialize the InequalityTerm, or in this case, throw an exception. A concept is not a variable.- Specified by:
initialize
in interfaceInequalityTerm
- Parameters:
object
- The object used to initialize the InequalityTerm; not used since a Concept is a static value that cannot be initialized.- Throws:
IllegalActionException
- Always thrown.
-
isAboveOrEqualTo
public boolean isAboveOrEqualTo(Concept concept) throws IllegalActionException
Return true if this concept is greater than or equal to the specified concept in the partial ordering. FIXME: This interface seems awkward, and should probably be removed, since it is obsoleted byConceptGraph.compare(Object, Object)
, which provides more functionality. See our discussion in our code review.- Parameters:
concept
- The concept to compare.- Returns:
- True if this concept is greater than or equal to the specified concept.
- Throws:
IllegalActionException
- If the specified concept does not have the same ontology as this one.
-
isSettable
public final boolean isSettable()
Return whether or not this InequalityTerm is settable. In this case, it is not, since concepts are constants, not variables.- Specified by:
isSettable
in interfaceInequalityTerm
- Returns:
- False, because this inequality term is a constant.
-
isValueAcceptable
public boolean isValueAcceptable()
Return whether this concept is a valid inference result. This method is required to implement the InequalityTerm interface, but we do not want to use this method going forward for ontology inferences. Acceptability criteria should be of the form variable ≤ Concept. Acceptability criteria prevent a variable from being promoted in the ontology lattice.- Specified by:
isValueAcceptable
in interfaceInequalityTerm
- Returns:
- True, if this concept is a valid result of inference. False, otherwise.
-
setValue
public final void setValue(java.lang.Object value) throws IllegalActionException
Try to set the value of this InequalityTerm, or in this case, just throw an exception. A concept is not a variable.- Specified by:
setValue
in interfaceInequalityTerm
- Parameters:
value
- The Object being passed in to set the value for the InequalityTerm; not used since a Concept is a static value that cannot be changed.- Throws:
IllegalActionException
- Always thrown.- See Also:
getValue()
-
-