Interface Transition<S,​E,​C>

  • Type Parameters:
    S - the type of state
    E - the type of event
    C - the type of user defined context, which is used to hold application data
    All Known Implementing Classes:
    TransitionImpl

    public interface Transition<S,​E,​C>
    Transition is something what a state machine associates with a state changes.
    Author:
    Frank Zhang
    • Method Detail

      • getSource

        State<S,​E,​C> getSource()
        Gets the source state of this transition.
        Returns:
        the source state
      • setSource

        void setSource​(State<S,​E,​C> state)
      • getEvent

        E getEvent()
      • setEvent

        void setEvent​(E event)
      • getTarget

        State<S,​E,​C> getTarget()
        Gets the target state of this transition.
        Returns:
        the target state
      • setTarget

        void setTarget​(State<S,​E,​C> state)
      • getCondition

        Condition<C> getCondition()
        Gets the guard of this transition.
        Returns:
        the guard
      • setCondition

        void setCondition​(Condition<C> condition)
      • setAction

        void setAction​(Action<S,​E,​C> action)
      • transit

        State<S,​E,​C> transit​(C ctx,
                                         boolean checkCondition)
        Do transition from source state to target state.
        Returns:
        the target state
      • verify

        void verify()
        Verify transition correctness