| Modifier and Type | Field and Description |
|---|---|
| private Action | |
| private static Action | |
| private boolean | |
| private Map | |
| private Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public StateEngine | |
| public StateEngine | |
| public StateEngine | |
| public StateEngine | |
| public static StateEngine | |
| public void | |
| public void | |
| private void | |
| private Action | |
| private State | |
| private Set | |
| public Set | |
| private void | |
| private void | |
| private void | |
| pack-priv void | |
| public StateEngine | setDefault(State oldState, Action action, State newState)
Set the default transition and action for a state. |
| public StateEngine | setDefault(State oldState, State newState)
Equivalent to setDefault( oldState, act, newState ) where act is an action that does nothing. |
| public StateEngine | |
| public void | |
| private void |
| defaultAction | back to summary |
|---|---|
| private Action defaultAction | |
| emptyAction | back to summary |
|---|---|
| private static Action emptyAction | |
| initializing | back to summary |
|---|---|
| private boolean initializing | |
| stateKinds | back to summary |
|---|---|
| private Map<State. | |
| unmodifiableStateKinds | back to summary |
|---|---|
| private Map<State. | |
| StateEngine | back to summary |
|---|---|
| private StateEngine() | |
| add | back to summary |
|---|---|
| public 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. Multiple calls to add with the same old and in are permitted, in which case only a transition in which the guard evaluates to true will be taken. If no such transition is enabled, a default will be taken. If more than one transition is enabled, one will be chosen arbitrarily. This method can only be called before done(). An attempt to call it after done() results in an IllegalStateException. | |
| add | back to summary |
|---|---|
| public 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. | |
| add | back to summary |
|---|---|
| public StateEngine add(State oldState, Input input, Action action, State newState) Add a transition with a guard that always evaluates to true. | |
| add | back to summary |
|---|---|
| public StateEngine add(State oldState, Set<Input> input, Action action, State newState) Repeatedly call add( State, Input, Action, State ) for each element of input. | |
| create | back to summary |
|---|---|
| public static StateEngine create() Create an empty uninitialized state engine. | |
| doIt | back to summary |
|---|---|
| public void doIt(Runner runner, Input in, boolean debug) Actually perform a state transition on the FSM on the runner.peek() FSM under Input in. | |
| done | back to summary |
|---|---|
| public void done() Called after all transitions have been added to the state engine. This provides an opportunity for the implementation to optimize its representation before the state engine is used. This method may only be called once. An attempt to call it more than once results in an IllegalStateException. Note that a valid StateEngine must satisfy the following conditions:
| |
| dprint | back to summary |
|---|---|
| private void dprint(String msg) | |
| getDefaultAction | back to summary |
|---|---|
| private Action getDefaultAction(State currentState) | |
| getDefaultNextState | back to summary |
|---|---|
| private State getDefaultNextState(State currentState) | |
| getKindSet | back to summary |
|---|---|
| private Set | |
| getStates | back to summary |
|---|---|
| public Set Return the set of final states for this state engine. This may be an empty set. | |
| innerDoIt | back to summary |
|---|---|
| private void innerDoIt(Runner runner, Input in, boolean debug) | |
| mustBeInitializing | back to summary |
|---|---|
| private void mustBeInitializing() | |
| mustNotBeInitializing | back to summary |
|---|---|
| private void mustNotBeInitializing() | |
| performStateTransition | back to summary |
|---|---|
| pack-priv void performStateTransition(Runner runner, Input in, State nextState, Action action, boolean debug) | |
| setDefault | back to summary |
|---|---|
| public StateEngine setDefault(State oldState, Action action, State newState) Set the default transition and action for a state. This transition will be used if no more specific transition was defined for the actual input. Repeated calls to this method simply change the default. This method can only be called before done(). An attempt to call it after done() results in an IllegalStateException. | |
| setDefault | back to summary |
|---|---|
| public StateEngine setDefault(State oldState, State newState) Equivalent to setDefault( oldState, act, newState ) where act is an action that does nothing. | |
| setDefault | back to summary |
|---|---|
| public StateEngine setDefault(State oldState) Euaivalent to setDefault( oldState, oldState ) | |
| setDefaultAction | back to summary |
|---|---|
| public void setDefaultAction(Action act) Set the default action used in this state engine. This is the action that is called whenever there is no applicable transition. Normally this would simply flag an error. This method can only be called before done(). An attempt to call it after done() results in an IllegalStateException. | |
| updateStateMap | back to summary |
|---|---|
| private void updateStateMap(State oldState, State newState) | |