public class Attribute extends NamedObj
NamedObj.ContainedObjectsIterator
_attributes, _changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Modifier | Constructor and Description |
---|---|
|
Attribute()
Construct an attribute in the default workspace with an empty string
as its name.
|
|
Attribute(NamedObj container,
java.lang.String name)
Construct an attribute with the given name contained by the specified
entity.
|
protected |
Attribute(NamedObj container,
java.lang.String name,
boolean incrementWorkspaceVersion)
Construct an attribute with the given name contained by the specified
entity.
|
|
Attribute(Workspace workspace)
Construct an attribute in the specified workspace with an empty
string as a name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_checkContainer(NamedObj container)
Check that the specified container is of a suitable class for
this attribute.
|
protected NamedObj |
_getContainedObject(NamedObj container,
java.lang.String relativeName)
Get an attribute with the specified name in the specified container.
|
protected NamedObj |
_propagateExistence(NamedObj container)
Propagate existence of this object to the
specified object.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
NamedObj |
getContainer()
Get the NamedObj that this Attribute is attached to.
|
int |
moveDown()
Move this object down by one in the list of attributes of
its container.
|
int |
moveToFirst()
Move this object to the first position in the list
of attributes of the container.
|
int |
moveToIndex(int index)
Move this object to the specified position in the list
of attributes of the container.
|
int |
moveToLast()
Move this object to the last position in the list
of attributes of the container.
|
int |
moveUp()
Move this object up by one in the list of
attributes of the container.
|
void |
setContainer(NamedObj container)
Specify the container NamedObj, adding this attribute to the
list of attributes in the container.
|
void |
setName(java.lang.String name)
Set the name of the attribute.
|
void |
updateContent()
Update the content of this attribute.
|
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _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, toString, uniqueName, validateSettables, workspace
public Attribute()
public Attribute(Workspace workspace)
workspace
- The workspace that will list the attribute.public Attribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.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.protected Attribute(NamedObj container, java.lang.String name, boolean incrementWorkspaceVersion) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.incrementWorkspaceVersion
- False to not add this to the workspace
or do anything else that might change the workspace version number.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 java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class NamedObj
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public int moveDown() throws IllegalActionException
moveDown
in interface Moveable
moveDown
in class NamedObj
IllegalActionException
- If this object has
no container.public int moveToFirst() throws IllegalActionException
moveToFirst
in interface Moveable
moveToFirst
in class NamedObj
IllegalActionException
- If this object has
no container.public int moveToIndex(int index) throws IllegalActionException
moveToIndex
in interface Moveable
moveToIndex
in class NamedObj
index
- The zero based position to which this object is moved.
0 means the first position, 1 means the second position.IllegalActionException
- If this object has
no container or if the index is out of bounds.public int moveToLast() throws IllegalActionException
moveToLast
in interface Moveable
moveToLast
in class NamedObj
IllegalActionException
- If this object has
no container.public int moveUp() throws IllegalActionException
moveUp
in interface Moveable
moveUp
in class NamedObj
IllegalActionException
- If this object has
no container.public NamedObj getContainer()
getContainer
in interface Nameable
getContainer
in class NamedObj
setContainer(NamedObj)
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Subclasses may constrain the type of container by overriding
setContainer(NamedObj)
.
container
- The container to attach this attribute to..IllegalActionException
- If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and 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 attribute.getContainer()
public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
setName
in interface Nameable
setName
in class NamedObj
name
- The new name.IllegalActionException
- If the name contains a period.NameDuplicationException
- If there is already an
attribute with the same name in the container.NamedObj.getName()
,
NamedObj.getName(NamedObj)
public void updateContent() throws InternalErrorException
InternalErrorException
- Not thrown in this base class.protected void _checkContainer(NamedObj container) throws IllegalActionException
container
- The proposed container.IllegalActionException
- If the container is not of
an acceptable class. Not thrown in this base class.protected NamedObj _getContainedObject(NamedObj container, java.lang.String relativeName) throws IllegalActionException
_getContainedObject
in class NamedObj
relativeName
- The name relative to the container.container
- The container expected to contain the object.IllegalActionException
- If the object exists
and has the wrong class.protected NamedObj _propagateExistence(NamedObj container) throws IllegalActionException
_propagateExistence
in class NamedObj
container
- Object to contain the new object.IllegalActionException
- If the object
cannot be cloned.