Package io.hektor.fsm
Interface State<S extends Enum<S>,C extends Context,D extends Data>
- All Known Implementing Classes:
StateImpl
- Author:
- jonas@jonasborjesson.com
-
Method Summary
Modifier and TypeMethodDescriptionSee if thisStatewould accept the given event.voidacceptVisitor(FsmVisitor<S, C, D> visitor) Retrieve a list of all other states this state is connected to.Optional<BiConsumer<C,D>> Optional<BiConsumer<C,D>> Optional<BiConsumer<C,D>> Optional<BiConsumer<C,D>> getState()Retrieve the enum value of the state.booleanisFinal()Check whether or not this state is final.booleanisInital()Check whether or not this state is initial.booleanCheck whether or not this state is a transient state.
-
Method Details
-
acceptVisitor
-
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
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
See if thisStatewould accept the given event.- Parameters:
event- the event to see if it is accepted by this state or not.- Returns:
- if the
Stateaccepts the event, then an theTransitionthat ultimatelely was the one accepting the event will be returned. If not, an emptyOptionalwill be returned.
-
getInitialEnterAction
Optional<BiConsumer<C,D>> getInitialEnterAction() -
getInitialEnterActionLabel
-
getSelfEnterAction
Optional<BiConsumer<C,D>> getSelfEnterAction() -
getSelfEnterActionLabel
-
getEnterAction
Optional<BiConsumer<C,D>> getEnterAction() -
getEnterActionLabel
-
getExitAction
Optional<BiConsumer<C,D>> getExitAction() -
getExitActionLabel
-