public class ComposedStateMachine<S,I,O> extends Object implements StateMachine<S,I,O>
| Modifier and Type | Method and Description |
|---|---|
Transition<S,O> |
apply(S state,
I input)
Apply the given input to the given state, returning a transition to a new state with 0 or more outputs.
|
java.util.stream.Stream<O> |
finish(S finalState)
Based on the final state (if non-terminal), obtain any "left-over" outputs when the end of the stream is reached.
|
S |
getInitialState() |
boolean |
isTerminal(S state)
Test whether a given state is terminal and stream traversal should stop.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, create, runner, runnerWithpublic S getInitialState()
getInitialState in interface StateMachine<S,I,O>public Transition<S,O> apply(S state, I input)
StateMachineapply in interface StateMachine<S,I,O>state - The state to transition from.input - The input to apply to the state.public boolean isTerminal(S state)
StateMachineisTerminal in interface StateMachine<S,I,O>state - The state to test.public java.util.stream.Stream<O> finish(S finalState)
StateMachinefinish in interface StateMachine<S,I,O>finalState - The state at the end of the stream.Copyright © 2020. All rights reserved.