public class UnitAttribute extends AbstractSettableAttribute
NamedObj.ContainedObjectsIterator
Settable.Visibility
Modifier and Type | Field and Description |
---|---|
(package private) Settable.Visibility |
_visibility |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
EXPERT, FULL, NONE, NOT_EDITABLE
Constructor and Description |
---|
UnitAttribute()
Construct a UnitsAttribute with no specific name, or container.
|
UnitAttribute(NamedObj container,
java.lang.String name)
Construct a UnitsAttribute with the specified name, and container.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_propagateValue(NamedObj destination)
Propagate the value of this object to the
specified object.
|
void |
addValueListener(ValueListener listener)
Add a listener to be notified when the value of this attribute changes.
|
void |
exportMoML(java.io.Writer output,
int depth,
java.lang.String name)
Write a MoML description of the UnitsAttribute.
|
java.lang.String |
getExpression()
Get the descriptive form of this attribute.
|
UnitConstraints |
getUnitConstraints()
Get the UnitConstraints.
|
UnitExpr |
getUnitExpr()
Get the Unit Expression.
|
Settable.Visibility |
getVisibility()
Get the visibility of this attribute, as set by setVisibility().
|
void |
removeValueListener(ValueListener listener)
Remove a listener from the list of listeners that is
notified when the value of this attribute changes.
|
void |
setExpression(java.lang.String expression)
Set the expression.
|
void |
setUnitConstraints(UnitConstraints constraints)
Set the UnitConstraints.
|
void |
setUnitExpr(UnitExpr expr)
Set the Unit Expression.
|
void |
setVisibility(Settable.Visibility visibility)
Set the visibility of this attribute.
|
java.util.Collection |
validate()
Check the validity of the expression set in setExpression().
|
getDefaultExpression, getValueAsString
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisplayName
description, getContainer, getFullName, getName, getName, setName
Settable.Visibility _visibility
public UnitAttribute() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If the attribute is not of an
acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the name coincides with
an attribute already in the container.public UnitAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Containername
- NameIllegalActionException
- If the attribute is not of an
acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the name coincides with
an attribute already in the container.public void addValueListener(ValueListener listener)
listener
- The listener to add.Settable.removeValueListener(ValueListener)
public void exportMoML(java.io.Writer output, int depth, java.lang.String name) throws java.io.IOException
exportMoML
in interface MoMLExportable
exportMoML
in class NamedObj
output
- The output stream to write to.depth
- The depth in the hierarchy, to determine indenting.name
- The name to use instead of the current name.java.io.IOException
- If an I/O error occurs.NamedObj.exportMoML(Writer, int, String)
public java.lang.String getExpression()
Settable.getExpression()
public UnitConstraints getUnitConstraints()
public UnitExpr getUnitExpr()
public Settable.Visibility getVisibility()
Settable.getVisibility()
public void removeValueListener(ValueListener listener)
listener
- The listener to remove.Settable.addValueListener(ValueListener)
public void setExpression(java.lang.String expression) throws IllegalActionException
setExpression
in interface Settable
setExpression
in class AbstractSettableAttribute
expression
- A String that is the descriptive form of either a Unit
or a UnitEquation.IllegalActionException
- If the expression is invalid
(not thrown in this base class).Settable.setExpression(java.lang.String)
public void setUnitConstraints(UnitConstraints constraints)
constraints
- The UnitConstraints.public void setUnitExpr(UnitExpr expr)
expr
- A UnitExpr.public void setVisibility(Settable.Visibility visibility)
visibility
- The visibility of this attribute.Settable.setVisibility(Settable.Visibility)
public java.util.Collection validate() throws IllegalActionException
Settable
IllegalActionException
- If the expression is not valid, or
its value is not acceptable to the container or the listeners.protected void _propagateValue(NamedObj destination) throws IllegalActionException
_propagateValue
in class NamedObj
destination
- Object to which to propagate the
value.IllegalActionException
- If the value cannot
be propagated.