com.cometway.states
Class StateModel

java.lang.Object
  extended by com.cometway.states.StateModel
All Implemented Interfaces:
StateModelInterface

public class StateModel
extends java.lang.Object
implements StateModelInterface

Implementation of the StateModelInterface.


Constructor Summary
StateModel(java.lang.String name)
          Constructor for a state model.
StateModel(java.lang.String name, CommandInterface command, TransitionInterface transition)
          Constructor for a state model.
 
Method Summary
 CommandInterface[] getCommands()
          Returns an array of CommandInterfaces for this state.
 java.lang.String getName()
          Returns the name of this state.
 TransitionInterface[] getTransitions()
          Returns an array of TransitionInterfaces for this state.
 void setCommand(CommandInterface command)
          Sets the specified CommandInterface as the only command for this state.
 void setCommands(CommandInterface[] commands)
          Sets the specified array of CommandInterfaces as the commands for this state.
 void setTransition(TransitionInterface transition)
          Sets the specified TransitionInterface as the only transition for this state.
 void setTransitions(TransitionInterface[] transitions)
          Sets the specified array of TransitionInterface as the transitions for this state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateModel

public StateModel(java.lang.String name)
Constructor for a state model.

Parameters:
name - name of this state.

StateModel

public StateModel(java.lang.String name,
                  CommandInterface command,
                  TransitionInterface transition)
Constructor for a state model.

Parameters:
name - name of this state.
command - a command for this state.
transition - a transition for this state.
Method Detail

getCommands

public CommandInterface[] getCommands()
Returns an array of CommandInterfaces for this state.

Specified by:
getCommands in interface StateModelInterface

getName

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

Specified by:
getName in interface StateModelInterface

getTransitions

public TransitionInterface[] getTransitions()
Returns an array of TransitionInterfaces for this state.

Specified by:
getTransitions in interface StateModelInterface

setCommand

public void setCommand(CommandInterface command)
Sets the specified CommandInterface as the only command for this state.


setCommands

public void setCommands(CommandInterface[] commands)
Sets the specified array of CommandInterfaces as the commands for this state.


setTransition

public void setTransition(TransitionInterface transition)
Sets the specified TransitionInterface as the only transition for this state.


setTransitions

public void setTransitions(TransitionInterface[] transitions)
Sets the specified array of TransitionInterface as the transitions for this state.