|
|||||||||
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
ptolemy.kernel.util.DecoratedAttributes
public abstract class DecoratedAttributes
An abstract class that represents a number of decorated attributes.
A NamedObj can contain DecoratedAttributes. These are attributes that are
added by another NamedObj, called a decorator to this NamedObj.
An example is a code generator that has specific attributes such as
parameters that control the code code generator. These attributes
are added by the Decorator (the code generator), to the director (the "this" object).
These attributes are stored separately and can be retrieved by using
NamedObj.getDecoratorAttributes(Decorator)
or
NamedObj.getDecoratorAttributes(Decorator)
.
A DecoratedAttributes instance has a decorator and decoratored attributes. The container of this class is the object that is being decorated.
The implementation class is DecoratedAttributesImplementation
,
the functionality is divided in two classes to solve dependency issues.
Red (rodiers) |
Red (rodiers) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary |
---|
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 | |
---|---|
DecoratedAttributes(NamedObj container,
java.lang.String name)
Construct a DecoratedAttributes instance with the given name and the container of the decorator. |
Method Summary | |
---|---|
protected abstract StringAttribute |
_decoratorPath()
Return the decorator path. |
protected void |
_register()
Register this attribute again to the container. |
void |
exportToMoML(NamedObj container,
java.io.Writer output,
int depth)
Export the Decorated attributes. |
abstract Decorator |
getDecorator()
Return the decorator. |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DecoratedAttributes(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container of this object.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.Method Detail |
---|
public void exportToMoML(NamedObj container, java.io.Writer output, int depth) throws InvalidStateException, java.io.IOException
container
- The container in which we store the the attribute.
This typically is the container of the decorator.output
- The output stream to write to.depth
- The depth in the hierarchy, to determine indenting.
java.io.IOException
- If an I/O error occurs.
InvalidStateException
- If a recursive structure is
encountered, where this object directly or indirectly contains
itself. Note that this is a runtime exception so it need not
be declared explicitly.public abstract Decorator getDecorator()
protected abstract StringAttribute _decoratorPath()
protected final void _register() throws NameDuplicationException, IllegalActionException
NameDuplicationException
- If the container already
has an attribute with the same name.
IllegalActionException
- If the attribute is not an
an instance of the expect class (in derived classes).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |