public abstract class AbstractActionsAttribute extends Action implements HasTypeConstraints
The value of this attribute is a semicolon separated list of commands, where each command gives a destination to send data to and a value to send. The actions are given by calling setExpression() with a string of the form:
command; command; ...where each command has the form:
destination = expressionwhere destination is either
nameor
name(number)
The expression is a string giving an expression in the usual Ptolemy II expression language. The expression may include references to variables and parameters contained by the FSM actor.
CommitActionsAttribute
,
Transition
,
FSMActor
Red (eal) |
Yellow (eal) |
NamedObj.ContainedObjectsIterator
Settable.Visibility
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
_destinationNames
List of destination names.
|
protected java.util.List |
_destinations
List of destinations.
|
protected long |
_destinationsListVersion
The workspace version number when the _destinations list is last
updated.
|
protected ParseTreeEvaluator |
_parseTreeEvaluator
The parse tree evaluator.
|
protected java.util.List |
_parseTrees
The list of parse trees.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
EXPERT, FULL, NONE, NOT_EDITABLE
Constructor and Description |
---|
AbstractActionsAttribute(NamedObj container,
java.lang.String name)
Construct an action with the given name contained
by the specified container (which should be a Transition when used in
the FSM domain, and an Event in the Ptera domain).
|
AbstractActionsAttribute(Workspace workspace)
Construct an action in the specified workspace with an empty
string as a name.
|
Modifier and Type | Method and Description |
---|---|
protected abstract NamedObj |
_getDestination(java.lang.String name)
Given a destination name, return a NamedObj that matches that
destination.
|
protected ParserScope |
_getParserScope()
Return a parser scope used to evaluate or type-check this action.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
execute()
Execute this action.
|
java.util.List |
getChannelNumberList()
Return the list of channel numbers given in expression set
for this attribute.
|
NamedObj |
getDestination(java.lang.String name)
Return the destination object referred to by the given name.
|
java.util.List |
getDestinationNameList()
Return the list of destination names given in expression set
for this attribute.
|
java.util.List |
getDestinations()
Return the list of destinations of assignments in this action.
|
java.lang.String |
getExpression(java.lang.String name)
Return the expression referred to by the given name.
|
ASTPtRootNode |
getParseTree(java.lang.String name)
Return the parse tree referred to by the given name.
|
java.util.List |
getParseTreeList()
Return the list of parse trees given in expression set
for this attribute.
|
boolean |
isChannelSpecified(java.lang.String name)
Test if a channel number is associated with the given name.
|
void |
setExpression(java.lang.String expression)
Set the action and notify the container
that the action has changed by calling attributeChanged(),
and notify any listeners that have
been registered using addValueListener().
|
java.lang.String |
toString()
Give a descriptive string.
|
java.util.Set<Inequality> |
typeConstraints()
Return the type constraints of this object.
|
setContainer
_propagateValue, addValueListener, exportMoML, getExpression, getVisibility, removeValueListener, setVisibility, validate
getDefaultExpression, getValueAsString
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, 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, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisplayName
description, getContainer, getFullName, getName, getName, setName
protected java.util.List _destinationNames
protected java.util.List _destinations
protected long _destinationsListVersion
protected ParseTreeEvaluator _parseTreeEvaluator
protected java.util.List _parseTrees
public AbstractActionsAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container that contains this action.name
- The name of this action.IllegalActionException
- If the action is not of an
acceptable class for the container, or if the name contains
a period.NameDuplicationException
- If the container already
has an attribute with the name.public AbstractActionsAttribute(Workspace workspace)
workspace
- The workspace that will list the attribute.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class StringAttribute
workspace
- The workspace for the new actor.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void execute() throws IllegalActionException
execute
in class Action
IllegalActionException
- If a destination is not found.public java.util.List getChannelNumberList() throws IllegalActionException
IllegalActionException
public NamedObj getDestination(java.lang.String name) throws IllegalActionException
name
- The name of the destination object.IllegalActionException
- If the given name is not a valid
destination for this action.public java.util.List getDestinations() throws IllegalActionException
getDestinations
in class Action
IllegalActionException
- If the destination list cannot be
constructed.public java.util.List getDestinationNameList()
public java.lang.String getExpression(java.lang.String name)
name
- The name of an expression.setExpression(java.lang.String)
public ASTPtRootNode getParseTree(java.lang.String name)
name
- The name of a parse tree.public java.util.List getParseTreeList()
public boolean isChannelSpecified(java.lang.String name)
name
- The channel name.public void setExpression(java.lang.String expression) throws IllegalActionException
setExpression
in interface Settable
setExpression
in class StringAttribute
expression
- The action.IllegalActionException
- If the change is not acceptable
to the container, or if the action is syntactically incorrect.getExpression(java.lang.String)
public java.lang.String toString()
public java.util.Set<Inequality> typeConstraints()
typeConstraints
in interface HasTypeConstraints
Inequality
protected abstract NamedObj _getDestination(java.lang.String name) throws IllegalActionException
name
- The name of the destination, or null if none is found.IllegalActionException
- If the associated FSMActor
does not have a destination with the specified name.protected ParserScope _getParserScope()