Package com.io7m.jfsm.core
Class FSMEnumMutable<T extends Enum<T>>
java.lang.Object
com.io7m.jfsm.core.FSMEnumMutable<T>
- Type Parameters:
T- The type of states
A mutable finite state machine.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<T>>
FSMEnumMutableBuilderType<T>builder(T init) Create a new builder.current()voidtransition(T state) Transition from the current state to the given state.
-
Method Details
-
builder
Create a new builder.- Type Parameters:
T- The type of states- Parameters:
init- The initial state- Returns:
- A new builder
-
current
- Returns:
- The current state
-
transition
Transition from the current state to the given state.- Parameters:
state- The target state- Throws:
FSMTransitionException- If no transition is allowed between the states
-