|
|||||||||
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.util.Attribute
ptolemy.kernel.util.AbstractSettableAttribute
ptolemy.kernel.util.StringAttribute
ptolemy.domains.modal.kernel.Action
ptolemy.domains.modal.kernel.AbstractActionsAttribute
public abstract class AbstractActionsAttribute
A base class for actions with semicolon delimited lists of commands.
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
,
Serialized Form
Red (eal) |
Yellow (eal) |
Nested Class Summary | |
---|---|
private class |
AbstractActionsAttribute.TypeFunction
|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable |
---|
Settable.Visibility |
Field Summary | |
---|---|
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. |
private java.util.List |
_numbers
List of channels. |
protected ParseTreeEvaluator |
_parseTreeEvaluator
The parse tree evaluator. |
protected java.util.List |
_parseTrees
The list of parse trees. |
private ParserScope |
_scope
The scope. |
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.kernel.util.Settable |
---|
EXPERT, FULL, NONE, NOT_EDITABLE |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
private void |
_updateDestinations()
|
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.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.util.Set<Inequality> |
typeConstraints()
Return the type constraints of this object. |
Methods inherited from class ptolemy.domains.modal.kernel.Action |
---|
setContainer |
Methods inherited from class ptolemy.kernel.util.StringAttribute |
---|
_propagateValue, addValueListener, exportMoML, getExpression, getVisibility, removeValueListener, setVisibility, validate |
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute |
---|
getDefaultExpression, getValueAsString |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.kernel.util.Settable |
---|
getDisplayName |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getFullName, getName, getName, setName |
Field Detail |
---|
protected java.util.List _destinationNames
protected java.util.List _destinations
protected long _destinationsListVersion
protected ParseTreeEvaluator _parseTreeEvaluator
protected java.util.List _parseTrees
private ParserScope _scope
private java.util.List _numbers
Constructor Detail |
---|
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.Method Detail |
---|
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class Attribute
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 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.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()
private void _updateDestinations() throws IllegalActionException
IllegalActionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |