org.glassfish.pfl.basic.fsm
Class FSMImpl

java.lang.Object
  extended by org.glassfish.pfl.basic.fsm.FSMImpl
All Implemented Interfaces:
FSM

public class FSMImpl
extends Object
implements FSM

This is the main class that represents an instance of a state machine using a state engine. It may be used as a base class, in which case the guards and actions have access to the derived class. Note that this is optional; an FSM implementation may directly implement the FSM interface if desired.

Author:
Ken Cavanaugh

Constructor Summary
FSMImpl(StateEngine se, State initialState)
           
 
Method Summary
 FSM getParent()
          Get the parent state machine.
 State getState()
          Return the current state.
 StateEngine getStateEngine()
          Return the state engine used to create this FSM.
 void setParent(FSM fsm)
          Set the parent state machine.
 void setState(State nextState)
          Set the current state of this FSM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSMImpl

public FSMImpl(StateEngine se,
               State initialState)
Method Detail

getParent

public FSM getParent()
Description copied from interface: FSM
Get the parent state machine.

Specified by:
getParent in interface FSM

setParent

public void setParent(FSM fsm)
Description copied from interface: FSM
Set the parent state machine.

Specified by:
setParent in interface FSM

getStateEngine

public StateEngine getStateEngine()
Description copied from interface: FSM
Return the state engine used to create this FSM.

Specified by:
getStateEngine in interface FSM

getState

public State getState()
Return the current state.

Specified by:
getState in interface FSM

setState

public void setState(State nextState)
Description copied from interface: FSM
Set the current state of this FSM. May not be called inside a transition action, or from a State method. Only here for use by the StateEngine.

Specified by:
setState in interface FSM


Copyright © 2013 Oracle. All Rights Reserved.