| Constructor and Description |
|---|
StateImpl(S state,
boolean isInitial,
boolean isFinal,
boolean isTransient,
List<Transition<?,S,C,D>> transitions,
Optional<Transition<?,S,C,D>> defaultTransition,
BiConsumer<C,D> enterAction,
BiConsumer<C,D> exitAction) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Transition<? extends Object,S,C,D>> |
accept(Object event,
C ctx,
D data)
See if this
State would accept the given event. |
List<S> |
getConnectedNodes()
Retrieve a list of all other states this state is connected to.
|
Optional<BiConsumer<C,D>> |
getEnterAction() |
Optional<BiConsumer<C,D>> |
getExitAction() |
S |
getState()
Retrieve the enum value of the state.
|
List<Transition<?,S,C,D>> |
getTransitionsToState(S state) |
boolean |
isFinal()
Check whether or not this state is final.
|
boolean |
isInital()
Check whether or not this state is initial.
|
boolean |
isTransient()
Check whether or not this state is a transient state.
|
public StateImpl(S state, boolean isInitial, boolean isFinal, boolean isTransient, List<Transition<?,S,C,D>> transitions, Optional<Transition<?,S,C,D>> defaultTransition, BiConsumer<C,D> enterAction, BiConsumer<C,D> exitAction)
public S getState()
Statepublic Optional<BiConsumer<C,D>> getEnterAction()
public Optional<BiConsumer<C,D>> getExitAction()
public boolean isInital()
Statepublic boolean isFinal()
Statepublic boolean isTransient()
Statepublic List<S> getConnectedNodes()
Statepublic Optional<Transition<? extends Object,S,C,D>> accept(Object event, C ctx, D data)
StateState would accept the given event.accept in interface State<S extends Enum<S>,C extends Context,D extends Data>event - the event to see if it is accepted by this state or not.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.Copyright © 2019. All rights reserved.