SMC
6_0_1

net.sf.smc.model
Class SmcState

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

public final class SmcState
extends SmcElement

Contains the entry action, exit action and transition lists. Also stores the owning map and this state's name.

See Also:
SmcMap, SmcTransition

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
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.
 
Method Summary
 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.
 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.
 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.
 
Methods inherited from class net.sf.smc.model.SmcElement
getLineNumber, merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmcState

public 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.

Parameters:
name - the state name.
lineNumber - where the state appears in the .sm file.
map - the state is in this map.
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

getMap

public SmcMap getMap()
Returns the map to which this state belongs.

Returns:
the map to which this state belongs.

getName

public java.lang.String getName()
Returns the state name.

Overrides:
getName in class SmcElement
Returns:
the state name.

getClassName

public java.lang.String getClassName()
Returns the state class name.

Returns:
the state class name.

getInstanceName

public java.lang.String getInstanceName()
Returns the state instance name.

Returns:
the state instance name.

getEntryActions

public java.util.List<SmcAction> getEntryActions()
Returns the entry action list.

Returns:
the entry action list.

getExitActions

public java.util.List<SmcAction> getExitActions()
Returns the exit action list.

Returns:
the exit action list.

getTransitions

public java.util.List<SmcTransition> getTransitions()
Returns the state transitions.

Returns:
the state transitions.

findTransition

public SmcTransition findTransition(java.lang.String name,
                                    java.util.List<SmcParameter> parameters)
Returns the transition with the specified name and parameters. May return null.

Parameters:
name - the transition name.
parameters - the transition parameters.
Returns:
the transition with the specified name and parameters.

setEntryActions

public void setEntryActions(java.util.List<SmcAction> actions)
Sets the state entry actions.

Parameters:
actions - the state entry actions.

setExitActions

public void setExitActions(java.util.List<SmcAction> actions)
Sets the state exit actions.

Parameters:
actions - the state exit actions.

addTransition

public void addTransition(SmcTransition transition)
Adds a transition to the list.

Parameters:
transition - add this transition.

toString

public java.lang.String toString()
Returns this state text representation.

Overrides:
toString in class java.lang.Object
Returns:
this state text representation.

SMC
6_0_1

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