Class TerminalState<E>

  • Type Parameters:
    E - The type of events the FSM processes.
    All Implemented Interfaces:
    InputState<E>, State<E>

    public class TerminalState<E>
    extends Object
    implements InputState<E>
    An FSM state. A terminal state ends normally an FSM.
    • Field Detail

      • fsm

        protected final FSM<E> fsm
      • name

        protected final String name
    • Constructor Detail

      • TerminalState

        public TerminalState​(FSM<E> stateMachine,
                             String stateName)
        Creates the terminal state.
        Parameters:
        stateMachine - The FSM that will contain the state.
        stateName - The name of this state.
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface State<E>
        Returns:
        The name of the state.
      • getFSM

        public FSM<E> getFSM()
        Specified by:
        getFSM in interface State<E>
        Returns:
        The FSM that contains the state.