SMC
6_0_1

net.sf.smc.model
Class SmcMap

java.lang.Object
  extended by net.sf.smc.model.SmcElement
      extended by net.sf.smc.model.SmcMap

public final class SmcMap
extends SmcElement

SMC has states grouped into maps. This class contains states in a list and stores the default state separately (if there is one).

See Also:
SmcFSM, SmcState

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.smc.model.SmcElement
SmcElement.TransType
 
Field Summary
 
Fields inherited from class net.sf.smc.model.SmcElement
_lineNumber, _name, NIL_STATE
 
Constructor Summary
SmcMap(java.lang.String name, int lineNumber, SmcFSM fsm)
          Creates a state machine map with the given name, line number and finite state machine.
 
Method Summary
 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.
 
Methods inherited from class net.sf.smc.model.SmcElement
getLineNumber, getName, merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmcMap

public SmcMap(java.lang.String name,
              int lineNumber,
              SmcFSM fsm)
Creates a state machine map with the given name, line number and finite state machine.

Method Detail

accept

public void accept(SmcVisitor visitor)
Calls the visitor's visit method for this finite state machine element.

Specified by:
accept in class SmcElement
Parameters:
visitor - The visitor instance.
See Also:
SmcVisitor

getFSM

public SmcFSM getFSM()
Returns the owning finite state machine.

Returns:
the owning finite state machine.

getStates

public java.util.List<SmcState> getStates()
Returns the map's states.

Returns:
the map's states.

findState

public boolean findState(SmcState state)
Returns true if the state is in the list and false otherwise.

Returns:
true if the state is in the list and false otherwise.

isKnownState

public boolean isKnownState(java.lang.String stateName)
Returns true if this map contains the nsamed state; false otherwise.

Returns:
true if this map contains the nsamed state; false otherwise.

hasDefaultState

public boolean hasDefaultState()
Returns true if this map has an explicitly defined default state and false otherwise.

Returns:
true if this map has an explicitly defined default state and false otherwise.

getDefaultState

public SmcState getDefaultState()
Returns the default state. May return null.

Returns:
the default state.

getAllStates

public java.util.List<SmcState> getAllStates()
Returns all states in this map including the default state.

Returns:
all states in this map including the default state.

getTransitions

public java.util.List<SmcTransition> getTransitions()
Returns all the transitions from all the states in this map.

Returns:
all the transitions from all the states in this map.

getUndefinedDefaultTransitions

public java.util.List<SmcTransition> getUndefinedDefaultTransitions()
Returns the list of transitions that do not appear in the default state.

Returns:
the list of transitions that do not appear in the default state.

hasEntryActions

public boolean hasEntryActions()
Returns true if at least one of the map's states has an entry action and false otherwise.

Returns:
true if at least one of the map's states has an entry action and false otherwise.

hasExitActions

public boolean hasExitActions()
Returns true if at least one of the map's states has an exit action and false otherwise.

Returns:
true if at least one of the map's states has an exit action and false otherwise.

getNextStateId

public static int getNextStateId()
Returns the next unique state identifier.

Returns:
the next unique state identifier.

addState

public void addState(SmcState state)
Adds a state to the list.

Parameters:
state - an FSM state.

toString

public java.lang.String toString()
Returns the map's text representation.

Overrides:
toString in class java.lang.Object
Returns:
the map's text representation.

SMC
6_0_1

Copyright © 2009. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.