|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public class TypedCompositeActor
A TypedCompositeActor is an aggregation of typed actors.
When exporting MoML, instances of this class identify their class name as TypedCompositeActor. If a derived class does not change this, then it too will be identified as a TypedCompositeActor. To change this in a derived class, put the following line in the constructor
setClassName(full class name");If you do this, you will probably also want to override _exportMoMLContents() to not generate a description of the contents of the composite, since they will be already defined in the Java class.
The ports of a TypedCompositeActor are constrained to be TypedIOPorts, the relations to be TypedIORelations, and the actors to be instances of ComponentEntity that implement the TypedActor interface. Derived classes may impose further constraints by overriding newPort(), _addPort(), newRelation(), _addRelation(), and _addEntity(). Also, derived classes may constrain the container by overriding _checkContainer().
TypedIOPort
,
TypedIORelation
,
TypedActor
,
ComponentEntity
,
CompositeActor
,
Serialized Form
Green (lmuliadi) |
Green (yuhong) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity |
---|
CompositeEntity.ContainedObjectsIterator |
Field Summary |
---|
Fields inherited from class ptolemy.actor.CompositeActor |
---|
_actorFiringListeners, _causalityInterface, _initializables, _notifyingActorFiring, _publishedPorts, _publisherRelations, _stopRequested |
Fields inherited from class ptolemy.kernel.CompositeEntity |
---|
_levelCrossingLinks |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _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 | |
---|---|
TypedCompositeActor()
Construct a TypedCompositeActor in the default workspace with no container and an empty string as its name. |
|
TypedCompositeActor(CompositeEntity container,
java.lang.String name)
Construct a TypedCompositeActor with a name and a container. |
|
TypedCompositeActor(Workspace workspace)
Construct a TypedCompositeActor in the specified workspace with no container and an empty string as a name. |
Method Summary | |
---|---|
protected void |
_addEntity(ComponentEntity entity)
Add an actor to this container with minimal error checking. |
protected void |
_addPort(Port port)
Add a port to this actor. |
protected void |
_addRelation(ComponentRelation relation)
Add a relation to this container. |
private java.util.List |
_checkDeclaredTypes()
|
protected java.util.List |
_checkTypesFromTo(TypedIOPort sourcePort,
java.util.List destinationPortList)
Check types from a source port to a group of destination ports, assuming the source port is connected to all the ports in the group of destination ports. |
private java.util.List |
_receiverToPort(Receiver[][] receivers)
|
protected java.util.List |
_typeConstraintsFromTo(TypedIOPort sourcePort,
java.util.List destinationPortList)
Return the type constraints on all connections starting from the specified source port to all the ports in a group of destination ports. |
Port |
newPort(java.lang.String name)
Create a new TypedIOPort with the specified name. |
ComponentRelation |
newRelation(java.lang.String name)
Create a new TypedIORelation with the specified name, add it to the relation list, and return it. |
static void |
resolveTypes(TypedCompositeActor topLevel)
Do type checking and type resolution on the specified composite actor. |
java.util.List |
typeConstraintList()
Deprecated. Use typeConstraints(). |
java.util.Set<Inequality> |
typeConstraints()
Return the type constraints of this typed composite actor. |
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 |
---|
_removePort, 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 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.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 |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Constructor Detail |
---|
public TypedCompositeActor()
public TypedCompositeActor(Workspace workspace)
workspace
- The workspace that will list the actor.public TypedCompositeActor(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.Method Detail |
---|
public Port newPort(java.lang.String name) throws NameDuplicationException
newPort
in class CompositeActor
name
- The name for the new port.
NameDuplicationException
- If this actor already has a
port with the specified name.public ComponentRelation newRelation(java.lang.String name) throws NameDuplicationException
newRelation
in class CompositeActor
name
- The name for the new TypedIORelation.
NameDuplicationException
- If name collides with a name
already on the container's contents list.public static void resolveTypes(TypedCompositeActor topLevel) throws TypeConflictException
topLevel
- The top level TypedCompositeActor.
java.lang.IllegalArgumentException
- If the specified actor is not the
top level container. That is, its container is not null.
TypeConflictException
- If a type conflict is detected.public java.util.Set<Inequality> typeConstraints() throws IllegalActionException
This method is read-synchronized on the workspace.
typeConstraints
in interface TypedActor
IllegalActionException
- If the typeConstraints
of one of the deeply contained objects throws it.Inequality
public java.util.List typeConstraintList() throws IllegalActionException
IllegalActionException
- If thrown while constructing
the set of type constraints.Inequality
protected void _addEntity(ComponentEntity entity) throws IllegalActionException, NameDuplicationException
_addEntity
in class CompositeActor
entity
- TypedActor to contain.
IllegalActionException
- If the actor 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.protected void _addPort(Port port) throws IllegalActionException, NameDuplicationException
_addPort
in class CompositeActor
port
- The TypedIOPort to add to this actor.
IllegalActionException
- If the port class is not
acceptable to this actor, or the port has no name.
NameDuplicationException
- If the port name collides with a
name already in the actor.protected void _addRelation(ComponentRelation relation) throws IllegalActionException, NameDuplicationException
_addRelation
in class CompositeActor
relation
- The TypedIORelation to contain.
IllegalActionException
- If the relation has no name, or is
not an instance of TypedIORelation.
NameDuplicationException
- If the name collides with a name
already on the contained relations list.protected java.util.List _checkTypesFromTo(TypedIOPort sourcePort, java.util.List destinationPortList)
sourcePort
- The source port.destinationPortList
- A list of destination ports.
protected java.util.List _typeConstraintsFromTo(TypedIOPort sourcePort, java.util.List destinationPortList)
sourcePort
- The source port.destinationPortList
- The destination port list.
private java.util.List _checkDeclaredTypes() throws IllegalActionException
IllegalActionException
private java.util.List _receiverToPort(Receiver[][] receivers)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |