|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.actor.lib.hoc.MultiCompositeActor
ptolemy.actor.gt.TransformationRule
public class TransformationRule
A transformation rule that contains a pattern and a replacement. It has two
purposes. As an abstraction of a transformation rule, it groups the pattern and
the replacement and relate objects between them (with PatternObjectAttribute
associated to objects in the replacement). As an actor,
it has a port that accepts model tokens containing models to be transformed,
and it produces transformed models in new model tokens to another port.
Red (tfeng) |
Yellow (tfeng) |
Nested Class Summary | |
---|---|
static class |
TransformationRule.TransformationDirector
A director to be associated with this actor, which does nothing. |
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity |
---|
CompositeEntity.ContainedObjectsIterator |
Field Summary | |
---|---|
private static java.util.Set<Inequality> |
_EMPTY_SET
An empty list. |
private static java.lang.String |
_FULL_CONTROL
The full control mode. |
private CompositeEntity |
_lastModel
The last received model. |
private java.util.List<MatchResult> |
_lastResults
The list of match results collected in the most recent pattern matching. |
private boolean |
_removeFirst
Whether the first match result should be removed in postfire. |
TypedIOPort |
matched
The matched port. |
TypedIOPort |
matchInput
The matchInput port. |
TypedIOPort |
matchOutput
The matchOutput port. |
TransformationMode |
mode
The mode. |
TypedIOPort |
modelInput
The modelInput port. |
TypedIOPort |
modelOutput
The modelOutput port. |
TypedIOPort |
remaining
The remaining port. |
Parameter |
repeatCount
The count of repeated transformation in one firing. |
Parameter |
repeatUntilFixpoint
Whether the transformation in one firing should continue until a fixpoint is reached. |
TypedIOPort |
trigger
The trigger port. |
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 | |
---|---|
TransformationRule(CompositeEntity container,
java.lang.String name)
Construct a transformation rule with a name and a container. |
|
TransformationRule(Workspace workspace)
Construct a transformation rule in the specified workspace with no container and an empty string as a name. |
Method Summary | |
---|---|
protected void |
_init()
Initialize the pattern, the replacement and the parameters of this transformation rule. |
void |
attributeChanged(Attribute attribute)
React to a change in the mode parameter or the repeatUntilFixpoint parameter, and update the appearance of this actor. |
java.lang.Object |
clone()
Clone the object into the current workspace by calling the clone() method that takes a Workspace argument. |
void |
fire()
Fire this actor. |
Pattern |
getPattern()
Get the pattern of this transformation rule. |
Replacement |
getReplacement()
Get the replacement of this transformation rule. |
void |
initialize()
Initialize this actor. |
boolean |
postfire()
If a trigger has been received in fire and the next match has been produced to the matchOutput port, remove the first match in the list. |
boolean |
prefire()
Test whether this actor can be fired, depending on the mode. |
java.util.Set<Inequality> |
typeConstraints()
Return an empty list. |
void |
valueChanged(Settable settable)
React to the change of mode and change the ports of this actor. |
void |
wrapup()
Wrap up the actor after an execution. |
Methods inherited from class ptolemy.actor.lib.hoc.MultiCompositeActor |
---|
newPort |
Methods inherited from class ptolemy.actor.TypedCompositeActor |
---|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _typeConstraintsFromTo, newRelation, resolveTypes, typeConstraintList |
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 |
---|
isFireFunctional, isStrict, iterate, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, preinitialize, removeInitializable |
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 |
---|
public TypedIOPort matchInput
public TypedIOPort matchOutput
public TypedIOPort matched
public TransformationMode mode
public TypedIOPort modelInput
public TypedIOPort modelOutput
public TypedIOPort remaining
public Parameter repeatCount
public Parameter repeatUntilFixpoint
public TypedIOPort trigger
private static final java.util.Set<Inequality> _EMPTY_SET
private static final java.lang.String _FULL_CONTROL
private CompositeEntity _lastModel
private java.util.List<MatchResult> _lastResults
private boolean _removeFirst
Constructor Detail |
---|
public TransformationRule(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 TransformationRule(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace that will list the actor.
IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.
NameDuplicationException
- If the container already contains
an entity with the specified name.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute changed.
IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class NamedObj
java.lang.CloneNotSupportedException
- If any of the attributes
cannot be cloned.public void fire() throws IllegalActionException
TransformationMode.Mode
.
fire
in interface Executable
fire
in class CompositeActor
IllegalActionException
- If error occurs in reading the input,
in sending the output, or in the transformation.public Pattern getPattern()
public Replacement getReplacement()
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class CompositeActor
IllegalActionException
- If the superclass throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class CompositeActor
IllegalActionException
- If thrown by the superclass.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class CompositeActor
IllegalActionException
- If thrown by the superclass or if the
mode cannot be retrieved.fire()
public java.util.Set<Inequality> typeConstraints() throws IllegalActionException
typeConstraints
in interface TypedActor
typeConstraints
in class TypedCompositeActor
IllegalActionException
- Not thrown in this class.Inequality
public void valueChanged(Settable settable)
valueChanged
in interface ValueListener
settable
- The attribute changed.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class CompositeActor
IllegalActionException
- If thrown by the superclass.protected void _init() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If some objects cannot be contained by
the proposed container.
NameDuplicationException
- If the name of an object coincides
with a name already in the container.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |