|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.aqueduct.StateMachineDescription<S,I>
I - The type of InputSource object used by States in this object to
find the next transition name.public class StateMachineDescription<S extends State<I>,I extends InputSource>
Contains State objects and the transitions between them. Intended to be an immutable data structure. The notion of current state is maintained by a separate StateMachine object which references a StateMachineDescription; this allows multiple instances of the state machine to run concurrently.
For best results, State objects should themselves be defined as immutable.
| Nested Class Summary | |
|---|---|
static class |
StateMachineDescription.Builder<S extends State<I>,I extends InputSource>
Convenience class that simplifies the code required to create a StateMachineDescription. |
| Constructor Summary | |
|---|---|
StateMachineDescription(S initialState,
java.util.Map<S,java.util.Map<java.lang.String,S>> transitions,
boolean setStateByIdAllowed)
|
|
| Method Summary | |
|---|---|
S |
findNextState(S state,
java.lang.String transitionValue)
Given a State and a transition name, returns the corresponding State that would be transitioned to. |
S |
findStateById(java.lang.String id)
Returns the State object with the provided id value. |
S |
getInitialState()
Returns the starting State described by this StateMachineDescription. |
boolean |
isGoToStateByIdAllowed()
Returns true if StateMachine objects based on this StateMachineDescription may be set directly to a state by providing a state id. |
StateMachine<S,I> |
newStateMachine(I inputSource)
Creates a new StateMachine instance that uses this StateMachineDescription to define its states and transitions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StateMachineDescription(S initialState,
java.util.Map<S,java.util.Map<java.lang.String,S>> transitions,
boolean setStateByIdAllowed)
| Method Detail |
|---|
public S getInitialState()
public boolean isGoToStateByIdAllowed()
public S findNextState(S state,
java.lang.String transitionValue)
state - transitionValue -
public S findStateById(java.lang.String id)
id -
public StateMachine<S,I> newStateMachine(I inputSource)
inputSource -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||