ptolemy.actor.gt
Class TransitionMatcher

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.Relation
          extended by ptolemy.kernel.ComponentRelation
              extended by ptolemy.domains.modal.kernel.Transition
                  extended by ptolemy.actor.gt.TransitionMatcher
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, GTEntity, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, ValueListener

public class TransitionMatcher
extends Transition
implements GTEntity, ValueListener

A matcher to match any transition in an FSM controller or scheduling relation in a Ptera controller.

Since:
Ptolemy II 8.0
Version:
$Id: TransitionMatcher.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  java.util.Set<java.lang.String> _labelSet
          Cache of the label set.
private  long _version
          The workspace version the last time when _labelSet was updated.
 GTIngredientsAttribute criteria
          The attribute containing all the criteria in a list (GTIngredientList).
 GTIngredientsEditor.Factory editorFactory
          The editor factory for ingredients in this matcher.
 GTIngredientsAttribute operations
          The attribute containing all the operations in a list (GTIngredientList).
 PatternObjectAttribute patternObject
          The attribute that specifies the name of the corresponding entity in the pattern.
 
Fields inherited from class ptolemy.domains.modal.kernel.Transition
annotation, defaultTransition, exitAngle, gamma, guardExpression, nondeterministic, outputActions, preemptive, refinementName, reset, setActions
 
Fields inherited from class ptolemy.kernel.Relation
_linkList
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
TransitionMatcher(FSMActor container, java.lang.String name)
          Construct a transition matcher with the given name contained by the specified entity.
 
Method Summary
 GTIngredientsAttribute getCriteriaAttribute()
          Return the attribute that stores all the criteria for this matcher.
 java.lang.String getDefaultIconDescription()
          Return null.
 GTIngredientsAttribute getOperationsAttribute()
          Return the attribute that stores all the operations for this matcher.
 PatternObjectAttribute getPatternObjectAttribute()
          Return the attribute that stores the name of the corresponding entity in the pattern of the same TransformationRule, if this entity is in the replacement, or null otherwise.
 java.util.Set<java.lang.String> labelSet()
          Return the set of names of ingredients contained in this entity that can be resolved.
 boolean match(NamedObj object)
          Return true if the given object matches any transition in an FSM controller or the modal model controller.
 void updateAppearance(GTIngredientsAttribute attribute)
          Update appearance of this entity.
 void valueChanged(Settable settable)
          React to the fact that the specified Settable has changed.
 
Methods inherited from class ptolemy.domains.modal.kernel.Transition
_checkPort, attributeChanged, choiceActionList, clone, commitActionList, destinationState, getGuardExpression, getLabel, getParseTreeEvaluator, getRefinement, isDefault, isEnabled, isEnabled, isNondeterministic, isPreemptive, setContainer, setGuardExpression, sourceState
 
Methods inherited from class ptolemy.kernel.ComponentRelation
_checkContainer, _checkRelation, _propagateExistence, deepLinkedPortList, deepLinkedPorts, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, unlinkAll
 
Methods inherited from class ptolemy.kernel.Relation
_description, _getContainedObject, link, linkedObjectsList, linkedPortList, linkedPortList, linkedPorts, linkedPorts, numLinks, relationGroupList, unlink
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
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
 

Field Detail

criteria

public GTIngredientsAttribute criteria
The attribute containing all the criteria in a list (GTIngredientList).


editorFactory

public GTIngredientsEditor.Factory editorFactory
The editor factory for ingredients in this matcher.


operations

public GTIngredientsAttribute operations
The attribute containing all the operations in a list (GTIngredientList).


patternObject

public PatternObjectAttribute patternObject
The attribute that specifies the name of the corresponding entity in the pattern.


_labelSet

private java.util.Set<java.lang.String> _labelSet
Cache of the label set.


_version

private long _version
The workspace version the last time when _labelSet was updated.

Constructor Detail

TransitionMatcher

public TransitionMatcher(FSMActor container,
                         java.lang.String name)
                  throws IllegalActionException,
                         NameDuplicationException
Construct a transition matcher with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This transition 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.

Parameters:
container - The container.
name - The name of the transition.
Throws:
IllegalActionException - If the container is incompatible with this transition.
NameDuplicationException - If the name coincides with any relation already in the container.
Method Detail

getCriteriaAttribute

public GTIngredientsAttribute getCriteriaAttribute()
Return the attribute that stores all the criteria for this matcher.

Specified by:
getCriteriaAttribute in interface GTEntity
Returns:
The attribute that stores all the criteria.

getDefaultIconDescription

public java.lang.String getDefaultIconDescription()
Return null.

Specified by:
getDefaultIconDescription in interface GTEntity
Returns:
null

getOperationsAttribute

public GTIngredientsAttribute getOperationsAttribute()
Return the attribute that stores all the operations for this matcher.

Specified by:
getOperationsAttribute in interface GTEntity
Returns:
The attribute that stores all the operations.

getPatternObjectAttribute

public PatternObjectAttribute getPatternObjectAttribute()
Return the attribute that stores the name of the corresponding entity in the pattern of the same TransformationRule, if this entity is in the replacement, or null otherwise.

Specified by:
getPatternObjectAttribute in interface GTEntity
Returns:
The attribute that stires the name of the corresponding entity.
See Also:
labelSet()

labelSet

public java.util.Set<java.lang.String> labelSet()
Return the set of names of ingredients contained in this entity that can be resolved.

Specified by:
labelSet in interface GTEntity
Returns:
The set of names.

match

public boolean match(NamedObj object)
Return true if the given object matches any transition in an FSM controller or the modal model controller.

Specified by:
match in interface GTEntity
Parameters:
object - The object to match.
Returns:
true if the object matches a transition.

updateAppearance

public void updateAppearance(GTIngredientsAttribute attribute)
Update appearance of this entity.

Specified by:
updateAppearance in interface GTEntity
Parameters:
attribute - The attribute containing ingredients of this entity.
See Also:
GTEntityUtils.updateAppearance(GTEntity, GTIngredientsAttribute)

valueChanged

public void valueChanged(Settable settable)
React to the fact that the specified Settable has changed.

Specified by:
valueChanged in interface ValueListener
Parameters:
settable - The object that has changed value.
See Also:
GTEntityUtils.valueChanged(GTEntity, Settable)