public class StateEngine extends Object
Modifier and Type | Method and Description |
---|---|
StateEngine |
add(State oldState,
Input input,
Action action,
State newState)
Add a transition with a guard that always evaluates to true.
|
StateEngine |
add(State oldState,
Input input,
Guard guard,
Action action,
State newState)
Add a new transition (old,in,guard,act,new) to the state engine.
|
StateEngine |
add(State oldState,
Set<Input> input,
Action action,
State newState)
Repeatedly call add( State, Input, Action, State ) for each
element of input.
|
StateEngine |
add(State oldState,
Set<Input> input,
Guard guard,
Action action,
State newState)
Repeatedly calls add( State, Input, Guard, Action, State ) for
each element of input.
|
static StateEngine |
create()
Create an empty uninitialized state engine.
|
void |
doIt(Runner runner,
Input in,
boolean debug)
Actually perform a state transition on the FSM on
the runner.peek() FSM under Input in.
|
void |
done()
Called after all transitions have been added to the state engine.
|
Set<State> |
getStates(State.Kind kind)
Return the set of final states for this state engine.
|
StateEngine |
setDefault(State oldState)
Euaivalent to setDefault( oldState, oldState )
|
StateEngine |
setDefault(State oldState,
Action action,
State newState)
Set the default transition and action for a state.
|
StateEngine |
setDefault(State oldState,
State newState)
Equivalent to setDefault( oldState, act, newState ) where act is an
action that does nothing.
|
void |
setDefaultAction(Action act)
Set the default action used in this state engine.
|
public static StateEngine create()
public Set<State> getStates(State.Kind kind)
public StateEngine add(State oldState, Input input, Guard guard, Action action, State newState)
public StateEngine add(State oldState, Set<Input> input, Guard guard, Action action, State newState)
public StateEngine add(State oldState, Input input, Action action, State newState)
public StateEngine add(State oldState, Set<Input> input, Action action, State newState)
public StateEngine setDefault(State oldState, Action action, State newState)
public StateEngine setDefault(State oldState, State newState)
public StateEngine setDefault(State oldState)
public void done()
Note that a valid StateEngine must satisfy the following conditions:
public void setDefaultAction(Action act)
Copyright © 2017 Oracle. All rights reserved.