Package ptolemy.domains.metroII.kernel
Class MetroIIMirrorComposite
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.kernel.CompositeEntity
-
- ptolemy.actor.CompositeActor
-
- ptolemy.actor.TypedCompositeActor
-
- ptolemy.domains.metroII.kernel.MetroIICompositeActor
-
- ptolemy.domains.metroII.kernel.MetroIIMirrorComposite
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,GetFirable
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,HandlesInternalLinks
- Direct Known Subclasses:
MetroIIPtidesPlatform
public class MetroIIMirrorComposite extends MetroIICompositeActor implements HandlesInternalLinks
A composite that contain one actor and mirror the ports and parameters of that actor.This class is identical to MirrorComposite except it extends MetroIICompositeActor instead of CompositeActor.
- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Edward A. Lee, Liangpeng Guo
- Pt.AcceptedRating:
- Red (neuendor)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetroIIMirrorComposite.MetroIIMirrorCompositeContents
This is a specialized composite actor for use in MirrorComposite.-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.CompositeActor
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
-
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description MetroIIMirrorComposite(CompositeEntity container, java.lang.String name)
Create an actor with a name and a container.MetroIIMirrorComposite(CompositeEntity container, java.lang.String name, boolean mirrorParameterPorts)
Create an actor with a name and a container that optionally mirrors the ports that are instances of ParameterPort.MetroIIMirrorComposite(Workspace workspace)
Construct a MirrorComposite in the specified workspace with no container and an empty string as a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
newParameterPort(java.lang.String name)
Create a new ParameterMirrorPort.Port
newPort(java.lang.String name)
Override the base class to return a specialized port.-
Methods inherited from class ptolemy.domains.metroII.kernel.MetroIICompositeActor
adapter, getfire
-
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeChanged, attributeTypeChanged, isBackwardTypeInferenceEnabled, newRelation, resolveTypes, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort, wrapup
-
Methods inherited from class ptolemy.kernel.CompositeEntity
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, 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.Entity
connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, 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, 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
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
MetroIIMirrorComposite
public MetroIIMirrorComposite(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.
-
MetroIIMirrorComposite
public MetroIIMirrorComposite(Workspace workspace)
Construct a MirrorComposite in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.- Parameters:
workspace
- The workspace that will list the actor.
-
MetroIIMirrorComposite
public MetroIIMirrorComposite(CompositeEntity container, java.lang.String name, boolean mirrorParameterPorts) throws IllegalActionException, NameDuplicationException
Create an actor with a name and a container that optionally mirrors the ports that are instances of ParameterPort. 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.mirrorParameterPorts
- If false, then ports that are instances of ParameterPort are not mirrored.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name coincides with an actor already in the container.
-
-
Method Detail
-
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 classCompositeActor
- 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:
CompositeEntity.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 classTypedCompositeActor
- 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.
-
newParameterPort
public Port newParameterPort(java.lang.String name) throws NameDuplicationException
Create a new ParameterMirrorPort.- Parameters:
name
- The name of the port to create.- Returns:
- A new instance of PtidesMirrorPort, 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 classTypedCompositeActor
- 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 classTypedCompositeActor
- 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 classCompositeEntity
- 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 classCompositeEntity
- 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 classEntity
- Parameters:
port
- The port being removed from this entity.
-
-