public class NamedObjVariable extends Variable
ObjectToken
containing the
NamedObj as its value.Red (tfeng) |
Yellow (tfeng) |
Variable.CircularDependencyError, Variable.VariableScope
NamedObj.ContainedObjectsIterator
Settable.Visibility
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME_PREFIX
Prefix of the names of any automatically generated NamedObjVariable.
|
_currentExpression, _needsEvaluation, _parserScope, _parseTreeValid, _valueListeners
_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 |
---|
NamedObjVariable(NamedObj container)
Construct a variable with a generated name as an attribute of the
given container.
|
NamedObjVariable(NamedObj container,
java.lang.String name)
Construct a variable with the given name as an attribute of the
given container.
|
Modifier and Type | Method and Description |
---|---|
static NamedObjVariable |
getNamedObjVariable(NamedObj container,
boolean autoCreate)
Get the NamedObjVariable contained in the container, and create a new
one if none is found in the container and autoCreate is true.
|
void |
setContainer(NamedObj container)
Specify the container, and add this variable to the list
of attributes in the container.
|
void |
setToken(Token token)
Put a new token in this variable and notify the container and
and value listeners.
|
_description, _evaluate, _notifyValueListeners, _parseIfNecessary, _propagate, _propagateToValueListeners, _propagateValue, _setToken, _setTokenAndNotify, addValueListener, clone, getDeclaredType, getExpression, getFreeIdentifiers, getParserScope, getScope, getScope, getToken, getType, getTypeTerm, getValueAsString, getVariable, getVisibility, invalidate, isKnown, isLazy, isStringMode, isTypeAcceptable, removeValueListener, reset, setExpression, setLazy, setName, setParseTreeEvaluator, setStringMode, setToken, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, setUnknown, setVisibility, stringRepresentation, toString, typeConstraintList, typeConstraints, validate, valueChanged
getDefaultExpression
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _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, 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, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisplayName
description, getContainer, getFullName, getName, getName
public static final java.lang.String NAME_PREFIX
public NamedObjVariable(NamedObj container) throws IllegalActionException, NameDuplicationException
container
- The container.IllegalActionException
- If the container does not accept
a variable as its attribute.NameDuplicationException
- If the name coincides with a
variable already in the container.public NamedObjVariable(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of the variable.IllegalActionException
- If the container does not accept
a variable as its attribute.NameDuplicationException
- If the name coincides with a
variable already in the container.public static NamedObjVariable getNamedObjVariable(NamedObj container, boolean autoCreate) throws IllegalActionException
container
- The container.autoCreate
- Whether a NamedObjVariable should be created if none
is found.IllegalActionException
- If variable of the container cannot be
retrieved, or a new one cannot be created.public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
If this method results in a change of container (which it usually does), then remove this variable from the scope of any scope dependent of this variable.
This method is write-synchronized on the workspace and increments its version number.
setContainer
in class Variable
container
- The proposed container of this variable.IllegalActionException
- If the container will not accept
a variable as its attribute, or this variable and the container
are not in the same workspace, or the proposed container would
result in recursive containment.NameDuplicationException
- If the container already has
an attribute with the name of this variable.Attribute.getContainer()
public void setToken(Token token) throws IllegalActionException
setPersistent(true
}
may need to be called so that the change to the token is
marked as persistent and is exported.
to the token is exporsetToken
in class Variable
token
- The new token to be stored in this variable.IllegalActionException
- If the token type is not
compatible with specified constraints, or if you are attempting
to set to null a variable that has value dependents, or if the
container rejects the change.Variable.getToken()