S - the type of the statesE - the type of the events that can trigger state changesC - the context events are fired inpublic interface StateMachine<S,E,C>
| Modifier and Type | Method and Description |
|---|---|
boolean |
fireEvent(E event)
Fires an event at the state machine, possibly triggering a state change
|
boolean |
fireEvent(E event,
C context)
Fires an event at the state machine, possibly triggering a state change
|
boolean |
forceSetState(S forcedState)
Forces the state machine to enter the forcedState even if there are no transitions leading to it
No transition actions are run but exit actions on the current state and entry actions on the new state are run
|
S |
getCurrentState()
Gets the current state of the machine
|
java.util.Map<E,java.util.Collection<? extends Transition<S,C>>> |
getPossibleTransitions(S fromState)
Returns all possible transitions from a given state grouped by the event that triggers the transition.
|
void |
rawSetState(S rawState)
Sets the state of the state machine to the rawState even if there are no transitions leading to it
No transition, entry or exit actions are run
|
S getCurrentState()
boolean fireEvent(E event)
event - the event that is firedboolean fireEvent(E event, C context)
event - the event that is firedcontext - the context to be sent to any actions that are run on a state change. Used to supply parameters to
actions and conditionsvoid rawSetState(S rawState)
rawState - the state the machine will be in after this method is calledboolean forceSetState(S forcedState)
forcedState - the state the machine will be in after this method is calledjava.util.Map<E,java.util.Collection<? extends Transition<S,C>>> getPossibleTransitions(S fromState)
fromState - the state to retrieve the outgoing transitions from.