Package io.hektor.fsm

Interface State<S extends Enum<S>,C extends Context,D extends Data>

All Known Implementing Classes:
StateImpl

public interface State<S extends Enum<S>,C extends Context,D extends Data>
Author:
jonas@jonasborjesson.com
  • Method Details

    • acceptVisitor

      void acceptVisitor(FsmVisitor<S,C,D> visitor)
    • getState

      S getState()
      Retrieve the enum value of the state.
    • isInital

      boolean isInital()
      Check whether or not this state is initial.
    • isFinal

      boolean isFinal()
      Check whether or not this state is final.
    • isTransient

      boolean isTransient()
      Check whether or not this state is a transient state.
    • getConnectedNodes

      List<S> getConnectedNodes()
      Retrieve a list of all other states this state is connected to. This is just the "forward" connections. I.e., if A is connected to B, then A would return a list of one element with B in it. However, B doesn't really know that A is connected to it so if you'd ask B for all its connections, then A would not be part of that list (unless of course you actually specified that on the B state explicitly)
      Returns:
      a list of states this state is connected to.
    • accept

      Optional<Transition<? extends Object,S,C,D>> accept(Object event, C ctx, D data)
      See if this State would accept the given event.
      Parameters:
      event - the event to see if it is accepted by this state or not.
      Returns:
      if the State accepts the event, then an the Transition that ultimatelely was the one accepting the event will be returned. If not, an empty Optional will be returned.
    • getInitialEnterAction

      Optional<BiConsumer<C,D>> getInitialEnterAction()
    • getInitialEnterActionLabel

      Optional<Label> getInitialEnterActionLabel()
    • getSelfEnterAction

      Optional<BiConsumer<C,D>> getSelfEnterAction()
    • getSelfEnterActionLabel

      Optional<Label> getSelfEnterActionLabel()
    • getEnterAction

      Optional<BiConsumer<C,D>> getEnterAction()
    • getEnterActionLabel

      Optional<Label> getEnterActionLabel()
    • getExitAction

      Optional<BiConsumer<C,D>> getExitAction()
    • getExitActionLabel

      Optional<Label> getExitActionLabel()