public final class SmcMap extends SmcElement
states
in a list and
stores the default state separately (if there is one).SmcElement.TransType
_lineNumber, _name, NIL_STATE
Constructor and Description |
---|
SmcMap(java.lang.String name,
int lineNumber,
SmcFSM fsm)
Creates a state machine map with the given name, line
number and finite state machine.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(SmcVisitor visitor)
Calls the visitor's visit method for this finite state
machine element.
|
void |
addState(SmcState state)
Adds a state to the list.
|
boolean |
findState(SmcState state)
Returns
true if the state is in the list and
false otherwise. |
java.util.List<SmcState> |
getAllStates()
Returns all states in this map including the default
state.
|
SmcState |
getDefaultState()
Returns the default state.
|
SmcFSM |
getFSM()
Returns the owning finite state machine.
|
static int |
getNextStateId()
Returns the next unique state identifier.
|
java.util.List<SmcState> |
getStates()
Returns the map's states.
|
java.util.List<SmcTransition> |
getTransitions()
Returns all the transitions from all the states in this
map.
|
java.util.List<SmcTransition> |
getUndefinedDefaultTransitions()
Returns the list of transitions that do not appear in the
default state.
|
boolean |
hasDefaultState()
Returns
true if this map has an explicitly
defined default state and false otherwise. |
boolean |
hasEntryActions()
Returns
true if at least one of the map's states
has an entry action and false otherwise. |
boolean |
hasExitActions()
Returns
true if at least one of the map's states
has an exit action and false otherwise. |
boolean |
isKnownState(java.lang.String stateName)
Returns
true if this map contains the nsamed
state; false otherwise. |
java.lang.String |
toString()
Returns the map's text representation.
|
getLineNumber, getName, merge
public SmcMap(java.lang.String name, int lineNumber, SmcFSM fsm)
name
- FSM map name.lineNumber
- .sm file where element begins.fsm
- the map resides in this FSM.public void accept(SmcVisitor visitor)
accept
in class SmcElement
visitor
- The visitor instance.SmcVisitor
public SmcFSM getFSM()
public java.util.List<SmcState> getStates()
public boolean findState(SmcState state)
true
if the state is in the list and
false
otherwise.state
- an FSM state.true
if the state is in the list and
false
otherwise.public boolean isKnownState(java.lang.String stateName)
true
if this map contains the nsamed
state; false
otherwise.stateName
- an FSM state name.true
if this map contains the nsamed
state; false
otherwise.public boolean hasDefaultState()
true
if this map has an explicitly
defined default state and false
otherwise.true
if this map has an explicitly
defined default state and false
otherwise.public SmcState getDefaultState()
null
.public java.util.List<SmcState> getAllStates()
public java.util.List<SmcTransition> getTransitions()
public java.util.List<SmcTransition> getUndefinedDefaultTransitions()
public boolean hasEntryActions()
true
if at least one of the map's states
has an entry action and false
otherwise.true
if at least one of the map's states
has an entry action and false
otherwise.public boolean hasExitActions()
true
if at least one of the map's states
has an exit action and false
otherwise.true
if at least one of the map's states
has an exit action and false
otherwise.public static int getNextStateId()
public void addState(SmcState state)
state
- an FSM state.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.