ptolemy.actor.lib.hoc
Class MirrorComposite
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.actor.lib.hoc.MirrorComposite
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, HandlesInternalLinks
- Direct Known Subclasses:
- IterateOverArray, RealTimeComposite
public class MirrorComposite
- extends TypedCompositeActor
- implements HandlesInternalLinks
This is a base class for actors that are simple composites that
contain one actor and mirror the ports and parameters of that
one actor.
- Since:
- Ptolemy II 6.1
- Version:
- $Id: MirrorComposite.java,v 1.4 2007/12/06 21:56:35 cxh Exp $
- Author:
- Edward A. Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Method Summary |
protected void |
_addEntity(ComponentEntity entity)
Override the base class to queue a change request to remove
any previously contained entity and its mirrored ports, and
to mirror the ports of the added entity. |
protected void |
_addPort(Port port)
Add a port to this actor. |
protected void |
_exportMoMLContents(java.io.Writer output,
int depth)
Override the base class to describe contained entities,
attributes, and ports, but not inside links or relations. |
protected void |
_removeEntity(ComponentEntity entity)
Override the base class to remove the ports and inside relations
of this actor. |
protected void |
_removePort(Port port)
Override the base class to remove the associated port on the
inside entity and the link to it, if there is one. |
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace. |
Port |
newPort(java.lang.String name)
Override the base class to return a specialized port. |
| Methods inherited from class ptolemy.actor.CompositeActor |
_actorFiring, _actorFiring, _createReceivers, _finishedAddEntity, _setDirector, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, fire, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, newInsideReceiver, newReceiver, outputPortList, postfire, prefire, preinitialize, recordFiring, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.CompositeEntity |
_adjustDeferrals, _description, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, entityList, entityList, exportLinks, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MirrorComposite
public MirrorComposite(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Create an actor with a name and a container.
The container argument must not be null, or a
NullPointerException will be thrown. This actor will use the
workspace of the container for synchronization and version counts.
If the name argument is null, then the name is set to the empty string.
Increment the version of the workspace.
- Parameters:
container - The container actor.name - The name of this actor.
- Throws:
IllegalActionException - If the container is incompatible
with this actor.
NameDuplicationException - If the name coincides with
an actor already in the container.
clone
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
- Clone the object into the specified workspace. This overrides
the base class to set up the associations in the mirror ports
and to set a flag indicating that cloning is complete.
- Overrides:
clone in class CompositeActor
- Parameters:
workspace - The workspace for the new object.
- Returns:
- A new NamedObj.
- Throws:
java.lang.CloneNotSupportedException - If any of the attributes
cannot be cloned.- See Also:
InstantiableNamedObj.exportMoML(Writer, int, String)
newPort
public Port newPort(java.lang.String name)
throws NameDuplicationException
- Override the base class to return a specialized port.
- Overrides:
newPort in class TypedCompositeActor
- Parameters:
name - The name of the port to create.
- Returns:
- A new instance of IteratePort, an inner class.
- Throws:
NameDuplicationException - If the container already has a port
with this name.
_addEntity
protected void _addEntity(ComponentEntity entity)
throws IllegalActionException,
NameDuplicationException
- Override the base class to queue a change request to remove
any previously contained entity and its mirrored ports, and
to mirror the ports of the added entity.
- Overrides:
_addEntity in class TypedCompositeActor
- Parameters:
entity - Entity to contain.
- Throws:
IllegalActionException - If the entity has no name, or the
action would result in a recursive containment structure, or the
argument does not implement the TypedActor interface.
NameDuplicationException - If the name collides with a name
already on the actor contents list, or if the added element is a
class definition.
_addPort
protected void _addPort(Port port)
throws IllegalActionException,
NameDuplicationException
- Add a port to this actor. This overrides the base class to
mirror the new port in the contained actor, if there is one,
and to establish a connection to a port on the contained actor.
- Overrides:
_addPort in class TypedCompositeActor
- Parameters:
port - The TypedIOPort to add to this actor.
- Throws:
IllegalActionException - If the port is not an instance
of IteratePort, or the port has no name.
NameDuplicationException - If the port name collides with a
name already in the actor.
_exportMoMLContents
protected void _exportMoMLContents(java.io.Writer output,
int depth)
throws java.io.IOException
- Override the base class to describe contained entities,
attributes, and ports, but not inside links or relations.
The rest of the contents are generated automatically when a
contained entity is inserted.
- Overrides:
_exportMoMLContents in class CompositeEntity
- Parameters:
output - The output to write to.depth - The depth in the hierarchy, to determine indenting.
- Throws:
java.io.IOException - If an I/O error occurs.- See Also:
NamedObj.exportMoML(Writer, int)
_removeEntity
protected void _removeEntity(ComponentEntity entity)
- Override the base class to remove the ports and inside relations
of this actor. This method assumes the caller has write access
on the workspace.
- Overrides:
_removeEntity in class CompositeEntity
- Parameters:
entity - The entity being removed from this entity.
_removePort
protected void _removePort(Port port)
- Override the base class to remove the associated port on the
inside entity and the link to it, if there is one.
This method assumes the caller has write access on the
workspace.
- Overrides:
_removePort in class Entity
- Parameters:
port - The port being removed from this entity.