public class TransformationRule extends MultiCompositeActor implements GTCompositeActor, ValueListener
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) |
Modifier and Type | Class and Description |
---|---|
static class |
TransformationRule.TransformationDirector
A director to be associated with this actor, which does nothing.
|
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
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.
|
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
mirrorContainerPortsInRefinement, newPort
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newRelation, resolveTypes, typeConstraintList
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _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
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isBackwardTypeInferenceEnabled
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
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
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.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class TypedCompositeActor
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
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.