public class MirrorDecorator extends TypedAtomicActor implements Decorator
Entity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Parameter> |
_addedParameters
A list containing the user added parameters.
|
protected java.util.List<java.lang.String> |
_addedPortNames
A list containing the names of user added ports.
|
protected java.util.List<java.lang.String> |
_addedPortParameterNames
A list containing the names of user added port parameters.
|
protected java.util.List<NamedObj> |
_decoratedObjects
Cached list of decorated objects.
|
protected long |
_decoratedObjectsVersion
Version for _decoratedObjects.
|
protected java.util.ArrayList<MirrorDecoratorListener> |
_listeners
Listeners registered to receive events from this object.
|
_typesValid_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
MirrorDecorator(CompositeEntity container,
java.lang.String name)
Construct a MirrorDecorator with a name and a container.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addAttribute(Attribute attr)
Add an attribute.
|
protected void |
_addPort(TypedIOPort port)
Add a port to this entity.
|
protected void |
_removeAttribute(Attribute attr)
Remove the given attribute.
|
protected void |
_removePort(Port port)
Remove the specified port.
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
DecoratorAttributes |
createDecoratorAttributes(NamedObj target)
Create and return the decorated attributes for the target NamedObj.
|
java.util.List<NamedObj> |
decoratedObjects()
Return the decorated objects.
|
java.util.List<Parameter> |
getAddedParameters()
Return the added paramters.
|
java.util.List<java.lang.String> |
getAddedPortNames()
Return the added port names.
|
java.util.List<java.lang.String> |
getAddedPortParameterNames()
Return the added port parameter names.
|
boolean |
isGlobalDecorator()
Return true to indicate that this decorator should
decorate objects across opaque hierarchy boundaries.
|
void |
registerListener(MirrorDecoratorListener monitor)
Add a communication aspect monitor to the list of listeners.
|
void |
sendParameterEvent(MirrorDecoratorListener.DecoratorEvent eventType,
Parameter parameter)
Notify the monitor that an event happened.
|
void |
sendPortEvent(MirrorDecoratorListener.DecoratorEvent eventType,
java.lang.String portName)
Notify the monitor that an event happened.
|
void |
setContainer(CompositeEntity container)
Override the base class to first set the container, then establish
a connection with any decorated objects it finds in scope in the new
container.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, stop, stopFire, terminate, wrapup_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_description, _exportMoMLContents, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamecreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListfire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminateaddInitializable, initialize, preinitialize, removeInitializable, wrapupgetDerivedLevel, getDerivedList, propagateValueprotected java.util.List<NamedObj> _decoratedObjects
protected long _decoratedObjectsVersion
protected java.util.ArrayList<MirrorDecoratorListener> _listeners
protected java.util.List<java.lang.String> _addedPortNames
protected java.util.List<java.lang.String> _addedPortParameterNames
protected java.util.List<Parameter> _addedParameters
public MirrorDecorator(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container.name - The name of this actor.IllegalActionException - If the container is incompatible
with this actor.NameDuplicationException - If the name coincides with
an actor already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
NamedObjattributeChanged in class NamedObjattribute - The attribute that changed.IllegalActionException - If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class TypedAtomicActorworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If any of the attributes
cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public DecoratorAttributes createDecoratorAttributes(NamedObj target)
DecoratorDecoratorAttributes. Implementations should populate that attribute
with parameters that have appropriate default values.
This method is called if NamedObj.getDecoratorAttribute(Decorator, String)
or NamedObj.getDecoratorAttributes(Decorator) is called,
and the specified target object does not already have
decorated attributes for this decorator.
The implementer of this method is responsible for ensuring consistency
with the Decorator.decoratedObjects() method. Specifically, any
object returned by Decorator.decoratedObjects(), when passed as an argument
to this method, should not result in a null returned value. And conversely,
any object passed to this method that is not in the list returned by
decoratedObjects() should result in a null returned value.
createDecoratorAttributes in interface Decoratortarget - The NamedObj that will be decorated.public java.util.List<NamedObj> decoratedObjects() throws IllegalActionException
decoratedObjects in interface DecoratorIllegalActionException - If some object cannot be determined to
be decorated or not (e.g., a parameter cannot be evaluated).public java.util.List<java.lang.String> getAddedPortNames()
public java.util.List<java.lang.String> getAddedPortParameterNames()
public java.util.List<Parameter> getAddedParameters()
public boolean isGlobalDecorator()
isGlobalDecorator in interface Decoratorpublic void registerListener(MirrorDecoratorListener monitor)
monitor - The communication aspect monitor.public void sendPortEvent(MirrorDecoratorListener.DecoratorEvent eventType, java.lang.String portName)
eventType - Type of event.portName - Name of port to be added/removedpublic void sendParameterEvent(MirrorDecoratorListener.DecoratorEvent eventType, Parameter parameter)
eventType - Type of event.parameter - Parameter to be added/removedpublic void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer in class AtomicActor<TypedIOPort>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.ComponentEntity.getContainer()protected void _addPort(TypedIOPort port) throws IllegalActionException, NameDuplicationException
Entity_addPort in class Entity<TypedIOPort>port - The port to add to this entity.IllegalActionException - If the port has no name.NameDuplicationException - If the port name collides with a
name already in the entity.protected void _removePort(Port port)
Entity_removePort in class Entity<TypedIOPort>port - The port being removed from this entity.protected void _addAttribute(Attribute attr) throws NameDuplicationException, IllegalActionException
NamedObjThis method is write-synchronized on the workspace and increments its version number.
_addAttribute in class NamedObjattr - The attribute to be added.NameDuplicationException - If this object already
has an attribute with the same name.IllegalActionException - If the attribute is not an
an instance of the expect class (in derived classes).protected void _removeAttribute(Attribute attr)
NamedObj_removeAttribute in class NamedObjattr - The attribute to be removed.