public final class SmcAction extends SmcElement implements java.lang.Comparable<SmcAction>
Actions have two properties:
true
, then the action
was a property assignment (var = value). This action is
supported only for C# and VB.Net target compilation.
_lineNumber, _name
Constructor and Description |
---|
SmcAction(java.lang.String name,
int lineNumber)
Creates the named action appearing on the given .sm line.
|
SmcAction(java.lang.String name,
int lineNumber,
boolean propertyFlag,
java.util.List<java.lang.String> arguments)
Creates an action with all data members specified.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(SmcVisitor visitor)
Pass this action to the visitor for processing.
|
int |
compareTo(SmcAction action)
Returns an integer value <, = or > zero depending
on whether this action is <, = or >
action . |
java.util.List<java.lang.String> |
getArguments()
Returns the action's argument list.
|
boolean |
isProperty()
Returns
true if this action is a .Net property
assignment and false if not. |
void |
setArguments(java.util.List<java.lang.String> args)
Sets the action's arguments.
|
void |
setProperty(boolean flag)
If
flag is true , then this action is a
.Net property assignment. |
java.lang.String |
toString()
Returns a textual representation of this action.
|
getLineNumber, getName
public SmcAction(java.lang.String name, int lineNumber)
name
- the action's name should correspond to the
FSM context method.lineNumber
- where the action appears in the .sm
file.public SmcAction(java.lang.String name, int lineNumber, boolean propertyFlag, java.util.List<java.lang.String> arguments) throws java.lang.IllegalArgumentException
name
- the action's name should correspond to the
FSM context method.lineNumber
- where the action appears in the .sm
file.propertyFlag
- if true
, then this action is
a .Net property assignment and arguments
must be
a non-null
list with exactly one item.args
- the action's arguments. May be null
.java.lang.IllegalArgumentException
- if propertyFlag
is true
and
arguments
is either null
or does not
contain exactly one item.public boolean isProperty()
true
if this action is a .Net property
assignment and false
if not.true
if this action is a .Net property
assignment and false
if not.public java.util.List<java.lang.String> getArguments()
null
.null
.public void setProperty(boolean flag)
flag
is true
, then this action is a
.Net property assignment.flag
- if true
, then this action is a .Net
property assignment.public void setArguments(java.util.List<java.lang.String> args) throws java.lang.IllegalArgumentException
args
- the action's arguments. May be null
.java.lang.IllegalArgumentException
- if this is a property action and arguments
is
either null
or does not contain exactly one item.public int compareTo(SmcAction action)
action
.compareTo
in interface java.lang.Comparable<SmcAction>
action
- comparison action object.action
.public java.lang.String toString()
toString
in class java.lang.Object
public void accept(SmcVisitor visitor)
accept
in class SmcElement
visitor
- the object implementing the
visit(SmcElement) method.