|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
public class AtomicActor
An AtomicActor is an executable entity that cannot itself contain other actors. The Ports of AtomicActors are constrained to be IOPorts. Derived classes may further constrain the ports by overriding the public method newPort() to create a port of the appropriate subclass, and the protected method _addPort() to throw an exception if its argument is a port that is not of the appropriate subclass. In this base class, the actor does nothing in the action methods (prefire, fire, ...).
CompositeActor,
IOPort,
Serialized Form
| Green (neuendor) |
| Green (eal) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
|---|
Entity.ContainedObjectsIterator |
| Field Summary | |
|---|---|
protected java.util.LinkedList |
_actorFiringListeners
The list of ActorFiringListeners registered with this object. |
protected java.util.List<Initializable> |
_initializables
List of objects whose (pre)initialize() and wrapup() methods should be slaved to these. |
protected boolean |
_notifyingActorFiring
Flag that is true if there are actor firing listeners. |
protected boolean |
_stopRequested
Indicator that a stop has been requested by a call to stop(). |
| 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 | |
|---|---|
AtomicActor()
Construct an actor in the default workspace with an empty string as its name. |
|
AtomicActor(CompositeEntity container,
java.lang.String name)
Create a new actor in the specified container with the specified name. |
|
AtomicActor(Workspace workspace)
Construct an actor in the specified workspace with an empty string as a name. |
|
| Method Summary | |
|---|---|
protected void |
_actorFiring(FiringEvent.FiringEventType type,
int multiplicity)
Send an actor firing event type to all actor firing listeners that have registered with this actor. |
protected void |
_actorFiring(FiringEvent event)
Send an actor firing event to all actor firing listeners that have registered with this actor. |
protected void |
_addPort(Port port)
Override the base class to throw an exception if the added port is not an instance of IOPort. |
protected void |
_createReceivers()
Create receivers for each input port. |
void |
addActorFiringListener(ActorFiringListener listener)
Append a listener to the current set of actor firing listeners. |
void |
addInitializable(Initializable initializable)
Add the specified object to the list of objects whose preinitialize(), intialize(), and wrapup() methods should be invoked upon invocation of the corresponding methods of this object. |
java.lang.Object |
clone(Workspace workspace)
Clone this actor into the specified workspace. |
void |
connectionsChanged(Port port)
Create new receivers if the port is an input port and there is a director. |
void |
fire()
Do nothing. |
Director |
getDirector()
Return the director responsible for the execution of this actor. |
Director |
getExecutiveDirector()
Return the executive director (same as getDirector()). |
FunctionDependency |
getFunctionDependency()
Return a representation of the function dependencies that output ports have on input ports. |
Manager |
getManager()
Return the Manager responsible for execution of this actor, if there is one. |
void |
initialize()
Initialize this actor. |
java.util.List |
inputPortList()
List all the input ports. |
boolean |
isFireFunctional()
Return true. |
boolean |
isStrict()
Return true in this base class. |
int |
iterate(int count)
Invoke a specified number of iterations of the actor. |
Port |
newPort(java.lang.String name)
Create a new IOPort with the specified name. |
Receiver |
newReceiver()
Return a new receiver of a type compatible with the director. |
java.util.List |
outputPortList()
List the output ports. |
boolean |
postfire()
Return true, unless stop() has been called, in which case, return false. |
boolean |
prefire()
Return true. |
void |
preinitialize()
Create receivers. |
void |
pruneDependencies()
Prune the dependency declarations, which by default state that each output port depends on all input ports in a firing. |
void |
recordFiring(FiringEvent.FiringEventType type)
Record a firing event. |
void |
removeActorFiringListener(ActorFiringListener listener)
Unregister an actor firing listener. |
void |
removeDependency(IOPort input,
IOPort output)
Remove the dependency that the specified output port has, by default, on the specified input port. |
void |
removeInitializable(Initializable initializable)
Remove the specified object from the list of objects whose preinitialize(), intialize(), and wrapup() methods should be invoked upon invocation of the corresponding methods of this object. |
void |
setContainer(CompositeEntity container)
Override the base class to invalidate the schedule and resolved types of the director. |
void |
stop()
Request that execution of the current iteration stop as soon as possible. |
void |
stopFire()
Request that execution of the current iteration complete. |
void |
terminate()
Terminate execution immediately. |
void |
wrapup()
Do nothing except invoke the wrapup() methods of any objects that have been registered with addInitializable(). |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
|---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
|---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
|---|
_setParent, exportMoML, 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.kernel.util.Nameable |
|---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
|---|
getDerivedLevel, getDerivedList, propagateValue |
| Field Detail |
|---|
protected java.util.LinkedList _actorFiringListeners
protected transient java.util.List<Initializable> _initializables
protected boolean _notifyingActorFiring
protected boolean _stopRequested
| Constructor Detail |
|---|
public AtomicActor()
public AtomicActor(Workspace workspace)
workspace - The workspace that will list this actor.
public AtomicActor(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - The name of this actor within the container.
IllegalActionException - If the entity cannot be contained
by the proposed container (see the setContainer() method).
NameDuplicationException - If the name coincides with
an entity already in the container.| Method Detail |
|---|
public void addInitializable(Initializable initializable)
addInitializable in interface Initializableinitializable - The object whose methods should be invoked.removeInitializable(Initializable),
CompositeActor.addPiggyback(Executable)public void addActorFiringListener(ActorFiringListener listener)
addActorFiringListener in interface FiringsRecordablelistener - The listener to which to send actor firing messages.removeActorFiringListener(ActorFiringListener)
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
clone in class ComponentEntityworkspace - The workspace for the cloned object.
java.lang.CloneNotSupportedException - If cloned ports cannot have
as their container the cloned entity (this should not occur), or
if one of the attributes cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void connectionsChanged(Port port)
connectionsChanged in class Entityport - The port that has connection changes.
public void fire()
throws IllegalActionException
fire in interface ExecutableIllegalActionException - Not thrown in this base class.public Director getDirector()
getDirector in interface Actorpublic Director getExecutiveDirector()
getExecutiveDirector in interface Actorpublic FunctionDependency getFunctionDependency()
getFunctionDependency in interface ActorFunctionDependencypublic Manager getManager()
getManager in interface Actor
public void initialize()
throws IllegalActionException
initialize in interface InitializableIllegalActionException - If a derived class throws it.public java.util.List inputPortList()
inputPortList in interface Actorpublic boolean isFireFunctional()
isFireFunctional in interface Executablepublic boolean isStrict()
isStrict in interface Executable
public int iterate(int count)
throws IllegalActionException
This base class method actually invokes prefire(), fire(), and postfire(), as described above, but a derived class may override the method to execute more efficient code.
iterate in interface Executablecount - The number of iterations to perform.
IllegalActionException - If iterating is not
permitted, or if prefire(), fire(), or postfire() throw it.
public Port newPort(java.lang.String name)
throws NameDuplicationException
newPort in class ComponentEntityname - The name for the new port.
NameDuplicationException - If this actor already has a port
with the specified name.Workspace.getWriteAccess()
public Receiver newReceiver()
throws IllegalActionException
newReceiver in interface ActorIllegalActionException - If there is no director.public java.util.List outputPortList()
outputPortList in interface Actor
public boolean postfire()
throws IllegalActionException
postfire in interface ExecutableIllegalActionException - Not thrown in this base class.
public boolean prefire()
throws IllegalActionException
prefire in interface ExecutableIllegalActionException - Not thrown in this base class.
public void preinitialize()
throws IllegalActionException
preinitialize in interface InitializableIllegalActionException - Not thrown in this base class.public void pruneDependencies()
TimedDelay,
removeDependency(IOPort, IOPort),
FunctionDependencyOfAtomicActorpublic void recordFiring(FiringEvent.FiringEventType type)
recordFiring in interface FiringsRecordabletype - The firing event to be recorded.public void removeActorFiringListener(ActorFiringListener listener)
removeActorFiringListener in interface FiringsRecordablelistener - The listener to remove from the list of listeners
to which actor firing messages are sent.addActorFiringListener(ActorFiringListener)
public void removeDependency(IOPort input,
IOPort output)
pruneDependencies() method if a particular output
port does not depend on data from a particular input port
in a firing. There should be one such call for each
input, output pair that does not have a dependency.
input - The input port.output - The output port that does not depend on the
input port.FunctionDependencyOfAtomicActorpublic void removeInitializable(Initializable initializable)
removeInitializable in interface Initializableinitializable - The object whose methods should no longer be invoked.addInitializable(Initializable),
CompositeActor.removePiggyback(Executable)
public void setContainer(CompositeEntity container)
throws IllegalActionException,
NameDuplicationException
setContainer in class ComponentEntitycontainer - The proposed container.
IllegalActionException - If the action would result in a
recursive containment structure, or if
this entity and container are not in the same workspace.
NameDuplicationException - If the container already has
an entity with the name of this entity.ComponentEntity.getContainer()public void stop()
stop in interface Executablepublic void stopFire()
stopFire in interface Executablepublic void terminate()
terminate in interface Executable
public void wrapup()
throws IllegalActionException
wrapup in interface InitializableIllegalActionException - Not thrown in this base class.protected final void _actorFiring(FiringEvent event)
event - The event.
protected final void _actorFiring(FiringEvent.FiringEventType type,
int multiplicity)
type - The type.multiplicity - The multiplicity of the firing, that is,
the number of times the firing will occur or has occurred.
protected void _addPort(Port port)
throws IllegalActionException,
NameDuplicationException
_addPort in class ComponentEntityport - The port to add to this entity.
IllegalActionException - If the port class is not
acceptable to this entity, or the port has no name.
NameDuplicationException - If the port name coincides with a
name already in the entity.
protected void _createReceivers()
throws IllegalActionException
IllegalActionException - If any port throws it.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||