Class DimensionRepresentativeConcept
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.data.ontologies.Concept
-
- ptolemy.data.ontologies.FiniteConcept
-
- ptolemy.data.ontologies.InfiniteConceptRepresentative
-
- ptolemy.data.ontologies.FlatTokenRepresentativeConcept
-
- ptolemy.data.ontologies.lattice.unit.DimensionRepresentativeConcept
-
- All Implemented Interfaces:
java.lang.Cloneable
,InequalityTerm
,Changeable
,Debuggable
,DebugListener
,Derivable
,Flowable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
BaseDimensionRepresentativeConcept
,DerivedDimensionRepresentativeConcept
public abstract class DimensionRepresentativeConcept extends FlatTokenRepresentativeConcept
A representative concept in the unitSystem ontology for a set of units for a specific physical dimension. This is an abstract base class for base and derived unit dimensions.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- See Also:
BaseDimensionRepresentativeConcept
,DerivedDimensionRepresentativeConcept
- Pt.AcceptedRating:
- Red (cshelton)
- Pt.ProposedRating:
- Red (cshelton)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected RecordToken[]
_userDefinedUnitRecords
The array of record tokens specified by the user in the unitInfoRecords parameter.Parameter
unitInfoRecords
The array of information records for the units for this dimension.-
Fields inherited from class ptolemy.data.ontologies.FiniteConcept
abovePort, belowPort
-
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 Constructor Description DimensionRepresentativeConcept(CompositeEntity ontology, java.lang.String name)
Create a new DimensionRepresentativeConcept with the specified name and ontology.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract UnitConcept
_createInfiniteConceptInstance(java.lang.String infiniteConceptString)
Return a UnitConcept instance from the given concept string representation.protected RecordToken
_findUnitRecordByName(java.lang.String unitName)
Return the unit info record token with the given Name field.void
attributeChanged(Attribute attribute)
React to a change in the unitInfoRecords parameter.java.util.List<? extends UnitConcept>
getAllUnits()
Return a list of all the possible units contained in this dimension representative concept.-
Methods inherited from class ptolemy.data.ontologies.FlatTokenRepresentativeConcept
_instantiateFlatTokenInfiniteConcept, containsThisInfiniteConceptString, getFlatTokenInfiniteConceptByToken
-
Methods inherited from class ptolemy.data.ontologies.InfiniteConceptRepresentative
_clearInstantiatedInfiniteConcepts, clone, getInfiniteConceptByString, getInstantiatedInfiniteConcepts
-
Methods inherited from class ptolemy.data.ontologies.FiniteConcept
getCoverSetAbove, getCoverSetBelow, getIncomingPort, getOutgoingPort, toString
-
Methods inherited from class ptolemy.data.ontologies.Concept
getAssociatedObject, getColor, getOntology, getValue, getVariables, initialize, isAboveOrEqualTo, isSettable, isValueAcceptable, setValue
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, 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, 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
-
unitInfoRecords
public Parameter unitInfoRecords
The array of information records for the units for this dimension.
-
_userDefinedUnitRecords
protected RecordToken[] _userDefinedUnitRecords
The array of record tokens specified by the user in the unitInfoRecords parameter.
-
-
Constructor Detail
-
DimensionRepresentativeConcept
public DimensionRepresentativeConcept(CompositeEntity ontology, java.lang.String name) throws NameDuplicationException, IllegalActionException
Create a new DimensionRepresentativeConcept with the specified name and 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
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
React to a change in the unitInfoRecords parameter. Update the array of user defined unit specification record tokens based on the value of the unitInfoRecords parameter.- Overrides:
attributeChanged
in classNamedObj
- Parameters:
attribute
- The attribute that has changed.- Throws:
IllegalActionException
- Thrown if there is a problem getting the token from the unitInfoRecords parameter.
-
getAllUnits
public java.util.List<? extends UnitConcept> getAllUnits() throws IllegalActionException
Return a list of all the possible units contained in this dimension representative concept.- Returns:
- The list of all UnitConcepts that have this DimensionRepresentativeConcept as a representative.
- Throws:
IllegalActionException
- Thrown if there is a problem getting any unit concepts from the ontology.
-
_createInfiniteConceptInstance
protected abstract UnitConcept _createInfiniteConceptInstance(java.lang.String infiniteConceptString) throws IllegalActionException
Return a UnitConcept instance from the given concept string representation. The string must represent one of the units specified for this physical dimension.- Overrides:
_createInfiniteConceptInstance
in classFlatTokenRepresentativeConcept
- Parameters:
infiniteConceptString
- The string that represents the unit concept to be returned.- Returns:
- The BaseUnitConcept represented by the given string.
- Throws:
IllegalActionException
- Thrown if there is a problem creating the unit concept.
-
_findUnitRecordByName
protected RecordToken _findUnitRecordByName(java.lang.String unitName) throws IllegalActionException
Return the unit info record token with the given Name field. First look in the array of user defined record tokens, and if it is not found there then look in the list of pre-specified unit parameters.- Parameters:
unitName
- The value of the Name field of the unit record token to be found.- Returns:
- The unit info RecordToken with the given Name field.
- Throws:
IllegalActionException
- Thrown if the unit cannot be found, or if the unit specification parameter is invalid.
-
-