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 FSMparentprivate Statestateprivate StateEnginestateEngine
-
Constructor Summary
Constructors Constructor Description FSMImpl(StateEngine se, State initialState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FSMgetParent()Get the parent state machine.StategetState()Return the current state.StateEnginegetStateEngine()Return the state engine used to create this FSM.voidsetParent(FSM fsm)Set the parent state machine.voidsetState(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:FSMGet the parent state machine.
-
setParent
public void setParent(FSM fsm)
Description copied from interface:FSMSet the parent state machine.
-
getStateEngine
public StateEngine getStateEngine()
Description copied from interface:FSMReturn the state engine used to create this FSM.- Specified by:
getStateEnginein interfaceFSM
-
-