Class OutputStateImpl<E>

  • Type Parameters:
    E - The type of events the FSM processes.
    All Implemented Interfaces:
    OutputState<E>, State<E>
    Direct Known Subclasses:
    InitState, StdState

    public abstract class OutputStateImpl<E>
    extends Object
    implements OutputState<E>
    Base implementation of the OutputState interface.
    • Field Detail

      • fsm

        protected final FSM<E> fsm
      • name

        protected final String name
    • Constructor Detail

      • OutputStateImpl

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

      • addTransition

        public void addTransition​(Transition<E> tr)
        Description copied from interface: OutputState
        Adds the given transitions to the list of outgoing transitions of the state.
        Specified by:
        addTransition in interface OutputState<E>
        Parameters:
        tr - The transition to add.
      • uninstall

        public void uninstall()
        Description copied from interface: State
        Uninstall (ie flushes) the state. Useful to clear data. The state must not be used after that.
        Specified by:
        uninstall in interface State<E>
      • 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.