Class DerivedUnitConcept
- 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
-
- ptolemy.data.ontologies.FlatTokenInfiniteConcept
-
- ptolemy.data.ontologies.lattice.unit.UnitConcept
-
- ptolemy.data.ontologies.lattice.unit.DerivedUnitConcept
-
- All Implemented Interfaces:
java.lang.Cloneable
,InequalityTerm
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class DerivedUnitConcept extends UnitConcept
A concept in the unitSystem ontology for a specific unit for a specific physical dimension. A unit for a derived dimension is defined by the physical dimension it measures and the multiplication factor and offset values required to convert a value in its unit measurement to a unit measurement in the SI unit for this dimension.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- See Also:
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 inherited from class ptolemy.data.ontologies.lattice.unit.UnitConcept
_unitFactor, _unitOffset
-
Fields inherited from class ptolemy.data.ontologies.FlatTokenInfiniteConcept
_representative, _tokenValue
-
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
DerivedUnitConcept(Ontology ontology, DerivedDimensionRepresentativeConcept representative, RecordToken unitInfo)
Create a new BaseUnitConcept, belonging to the given ontology.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DerivedUnitConcept
createDerivedUnitConcept(Ontology ontology, DerivedDimensionRepresentativeConcept representative, RecordToken unitInfo)
Create a new derived unit concept, belonging to the given ontology, with an automatically generated name.static Concept
findUnitByComponentMapsAndUnitFactor(java.util.Map<DimensionRepresentativeConcept,java.lang.Integer> dimensionMap, java.util.Map<DimensionRepresentativeConcept,java.util.List<UnitConcept>> componentUnitsMap, ScalarToken newUnitFactor, Ontology unitOntology)
Find the DerivedUnitConcept that contains the given dimension and component unit maps and the given unit conversion factor, or null if the unit doesn't exist in the ontology.java.util.Map<BaseDimensionRepresentativeConcept,java.util.List<BaseUnitConcept>>
getComponentBaseUnits()
Get the base component units map for this DerivedUnitConcept.java.util.Map<DimensionRepresentativeConcept,java.util.List<UnitConcept>>
getComponentUnits()
Get the component units map for this DerivedUnitConcept.-
Methods inherited from class ptolemy.data.ontologies.lattice.unit.UnitConcept
canBeConvertedTo, getDimension, getUnitFactor, getUnitName, getUnitOffset, toString
-
Methods inherited from class ptolemy.data.ontologies.FlatTokenInfiniteConcept
compare, createFlatTokenInfiniteConcept, equals, getColor, getRepresentative, getTokenValue, greatestLowerBound, hashCode, leastUpperBound
-
Methods inherited from class ptolemy.data.ontologies.Concept
getAssociatedObject, getOntology, getValue, getVariables, initialize, isAboveOrEqualTo, isSettable, isValueAcceptable, setValue
-
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
-
DerivedUnitConcept
protected DerivedUnitConcept(Ontology ontology, DerivedDimensionRepresentativeConcept representative, RecordToken unitInfo) throws IllegalActionException, NameDuplicationException
Create a new BaseUnitConcept, belonging to the given ontology.- Parameters:
ontology
- The ontology to which this concept belongs.representative
- The finite concept that represents the physical dimension for the set infinite concepts that represent units for this dimension in the ontology lattice.unitInfo
- The record token value that has the name and scale factor information for this unit.- Throws:
NameDuplicationException
- Should never be thrown.IllegalActionException
- If the base class throws it.
-
-
Method Detail
-
createDerivedUnitConcept
public static DerivedUnitConcept createDerivedUnitConcept(Ontology ontology, DerivedDimensionRepresentativeConcept representative, RecordToken unitInfo) throws IllegalActionException
Create a new derived unit concept, belonging to the given ontology, with an automatically generated name.- Parameters:
ontology
- The ontology to which this concept belongs.representative
- The finite concept that represents where the infinite token concepts belong in the ontology lattice.unitInfo
- The token value for this FlatTokenInfiniteConcept.- Returns:
- The newly created RecordConcept.
- Throws:
IllegalActionException
- If the base class throws it.
-
findUnitByComponentMapsAndUnitFactor
public static Concept findUnitByComponentMapsAndUnitFactor(java.util.Map<DimensionRepresentativeConcept,java.lang.Integer> dimensionMap, java.util.Map<DimensionRepresentativeConcept,java.util.List<UnitConcept>> componentUnitsMap, ScalarToken newUnitFactor, Ontology unitOntology) throws IllegalActionException
Find the DerivedUnitConcept that contains the given dimension and component unit maps and the given unit conversion factor, or null if the unit doesn't exist in the ontology.- Parameters:
dimensionMap
- The map of component dimensions to their exponents for this unit dimension.componentUnitsMap
- The map that links the component dimensions to a list component units for that dimension.newUnitFactor
- The unit factor for the UnitConcept to be found.unitOntology
- The ontology for the unit dimensions.- Returns:
- The DerivedUnitConcept that contains the dimension and component maps, or the top of the lattice if no matching unit is found.
- Throws:
IllegalActionException
- Thrown if there is a problem getting the unit dimension.
-
getComponentBaseUnits
public java.util.Map<BaseDimensionRepresentativeConcept,java.util.List<BaseUnitConcept>> getComponentBaseUnits()
Get the base component units map for this DerivedUnitConcept. This map links the base component dimensions with the list of base units for each dimension.- Returns:
- The component units map.
-
getComponentUnits
public java.util.Map<DimensionRepresentativeConcept,java.util.List<UnitConcept>> getComponentUnits()
Get the component units map for this DerivedUnitConcept. This map links the component dimensions with the list of units for each dimension.- Returns:
- The component units map.
-
-