Class FSMEnumMutable<T extends Enum<T>>

java.lang.Object
com.io7m.jfsm.core.FSMEnumMutable<T>
Type Parameters:
T - The type of states

public final class FSMEnumMutable<T extends Enum<T>> extends Object
A mutable finite state machine.
  • Method Details

    • builder

      public static <T extends Enum<T>> FSMEnumMutableBuilderType<T> builder(T init)
      Create a new builder.
      Type Parameters:
      T - The type of states
      Parameters:
      init - The initial state
      Returns:
      A new builder
    • current

      public T current()
      Returns:
      The current state
    • transition

      public void transition(T state) throws FSMTransitionException
      Transition from the current state to the given state.
      Parameters:
      state - The target state
      Throws:
      FSMTransitionException - If no transition is allowed between the states