|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
public class Attribute
Attribute is a base class for attributes to be attached to instances of NamedObj. This base class is itself a NamedObj, with the only extension being that it can have a container. The setContainer() method puts this object on the list of attributes of the container.
Green (johnr) |
Green (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private NamedObj |
_container
|
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_attributes, _changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private NamedObj _container
Constructor Detail |
---|
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.Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |