Package org.glassfish.pfl.basic.fsm
Class FSMImpl
- java.lang.Object
-
- org.glassfish.pfl.basic.fsm.FSMImpl
-
- All Implemented Interfaces:
FSM
public class FSMImpl extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description private FSM
parent
private State
state
private StateEngine
stateEngine
-
Constructor Summary
Constructors Constructor Description FSMImpl(StateEngine se, State initialState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Field Detail
-
parent
private FSM parent
-
state
private State state
-
stateEngine
private StateEngine stateEngine
-
-
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.
-
setParent
public void setParent(FSM fsm)
Description copied from interface:FSM
Set the parent state machine.
-
getStateEngine
public StateEngine getStateEngine()
Description copied from interface:FSM
Return the state engine used to create this FSM.- Specified by:
getStateEngine
in interfaceFSM
-
-