| Constructor and Description |
|---|
FsmImpl(Object uuid,
State[] states,
S initialState,
C ctx,
D data,
BiConsumer<S,Object> unhandledEventHandler,
TransitionListener<S> transitionListener) |
| Modifier and Type | Method and Description |
|---|---|
S |
getState()
The state in which this FSM currently is.
|
boolean |
isStarted() |
boolean |
isTerminated()
The FSM is in its terminated state if it has reached the final
state.
|
void |
onEvent(Object event)
Deliver an event to this
FSM. |
void |
reStartAndEnter(S state)
Re-start the FSM and enter the specified state.
|
void |
start()
You must call
FSM.start() on the FSM before it can be used. |
public FsmImpl(Object uuid, State[] states, S initialState, C ctx, D data, BiConsumer<S,Object> unhandledEventHandler, TransitionListener<S> transitionListener)
public final boolean isStarted()
public final boolean isTerminated()
FSMpublic final void start()
FSMFSM.start() on the FSM before it can be used.
This will cause the FSM to "transition" from a null state to its initial state.
Any enter actions associated with the initial state will naturally now be called.
Note: calling this method when the FSM is already started will silently
be ignored.public void reStartAndEnter(S state) throws IllegalArgumentException
FSMreStartAndEnter in interface FSM<S extends Enum<S>,C extends Context,D extends Data>IllegalArgumentException - in case the state is nullpublic final void onEvent(Object event)
FSMFSM.Copyright © 2019. All rights reserved.