S
- type of states in the state machineE
- type of events in the state machinefinal class State<S extends java.lang.Enum<S>,E extends java.lang.Enum<E>>
extends java.lang.Object
A state within a state machine.
Modifier and Type | Field and Description |
---|---|
private S |
name |
private io.vavr.collection.Seq<S> |
targetStates |
private boolean |
terminal |
private io.vavr.collection.Map<E,Transition<S,E>> |
transitions |
Constructor and Description |
---|
State(S name,
boolean terminal,
io.vavr.collection.Map<E,Transition<S,E>> transitions) |
Modifier and Type | Method and Description |
---|---|
boolean |
is(S other) |
boolean |
isNextState(S other) |
boolean |
isTerminal() |
S |
name() |
java.lang.String |
toString() |
io.vavr.control.Option<Transition<S,E>> |
transitionForEvent(E event) |
io.vavr.collection.Seq<Transition<S,E>> |
transitions() |
private final boolean terminal
private final io.vavr.collection.Map<E extends java.lang.Enum<E>,Transition<S extends java.lang.Enum<S>,E extends java.lang.Enum<E>>> transitions
State(S name, boolean terminal, io.vavr.collection.Map<E,Transition<S,E>> transitions)
public S name()
public io.vavr.control.Option<Transition<S,E>> transitionForEvent(E event)
public io.vavr.collection.Seq<Transition<S,E>> transitions()
public boolean isTerminal()
public boolean is(S other)
public boolean isNextState(S other)
public java.lang.String toString()
toString
in class java.lang.Object