public final class SmcState extends SmcElement
map
and this state's name.SmcMap
,
SmcTransition
SmcElement.TransType
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_STATE
The default state instance name is "DefaultState".
|
_lineNumber, _name, NIL_STATE
Constructor and Description |
---|
SmcState(java.lang.String name,
int lineNumber,
SmcMap map)
Creates a state instance for the given state name, the
line number where the state appears in the .sm file and
the map to which this state belongs.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(SmcVisitor visitor)
Calls the visitor's visit method for this finite state
machine element.
|
void |
addTransition(SmcTransition transition)
Adds a transition to the list.
|
boolean |
callDefault(java.lang.String name) |
SmcGuard |
findGuard(java.lang.String name,
java.lang.String condition)
Returns the guard with the specified name and
condition.
|
SmcTransition |
findTransition(java.lang.String name,
java.util.List<SmcParameter> parameters)
Returns the transition with the specified name and
parameters.
|
java.lang.String |
getClassName()
Returns the state class name.
|
java.util.List<SmcAction> |
getEntryActions()
Returns the entry action list.
|
java.util.List<SmcAction> |
getExitActions()
Returns the exit action list.
|
java.lang.String |
getInstanceName()
Returns the state instance name.
|
SmcMap |
getMap()
Returns the map to which this state belongs.
|
java.lang.String |
getName()
Returns the state name.
|
java.util.List<SmcTransition> |
getTransitions()
Returns the state transitions.
|
boolean |
isDefaultState()
Returns
true if this is the default state and
false otherwise. |
void |
setEntryActions(java.util.List<SmcAction> actions)
Sets the state entry actions.
|
void |
setExitActions(java.util.List<SmcAction> actions)
Sets the state exit actions.
|
java.lang.String |
toString()
Returns this state text representation.
|
getLineNumber, merge
public static final java.lang.String DEFAULT_STATE
public SmcState(java.lang.String name, int lineNumber, SmcMap map)
name
- the state name.lineNumber
- where the state appears in the .sm file.map
- the state is in this map.public void accept(SmcVisitor visitor)
accept
in class SmcElement
visitor
- The visitor instance.SmcVisitor
public SmcMap getMap()
public java.lang.String getName()
getName
in class SmcElement
public java.lang.String getClassName()
public java.lang.String getInstanceName()
public boolean isDefaultState()
true
if this is the default state and
false
otherwise.true
if this is the default state.public java.util.List<SmcAction> getEntryActions()
public java.util.List<SmcAction> getExitActions()
public java.util.List<SmcTransition> getTransitions()
public SmcTransition findTransition(java.lang.String name, java.util.List<SmcParameter> parameters)
null
.name
- the transition name.parameters
- the transition parameters.public SmcGuard findGuard(java.lang.String name, java.lang.String condition)
null
.name
- the transition name.condition
- the condition guardpublic boolean callDefault(java.lang.String name)
name
- the transition name.public void setEntryActions(java.util.List<SmcAction> actions)
actions
- the state entry actions.public void setExitActions(java.util.List<SmcAction> actions)
actions
- the state exit actions.public void addTransition(SmcTransition transition)
transition
- add this transition.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2015. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.