|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.aqueduct.StateMachine<S,I>
I
- The type of InputSource object used by States in this state
machine to find the next transition name.public class StateMachine<S extends State<I>,I extends InputSource>
Maintains the current state and InputSource used by a particular execution of a StateMachineDescription.
Constructor Summary | |
---|---|
StateMachine(StateMachineDescription<S,I> stateMachineDescription,
I inputSource)
|
Method Summary | |
---|---|
void |
addStateEventListener(S state,
StateEventListener<I> listener)
Registers a StateEventListener to receive transition event notifications for the indicated State. |
S |
getCurrentState()
|
void |
goToNextState()
Performs a single state transition and fires the requisite StateEventListener event handler methods. |
void |
goToStateById(java.lang.String id)
Transitions this StateMachine to the state named by the id parameter. |
void |
removeStateEventListener(S state,
StateEventListener<I> listener)
Unregisters a StateEventListener that is receiving transition event notifications for the provided State. |
void |
runUntilStopState()
Calls goToNextState() until currentState.isStopState() returns true or until the stopRunningUntilStopState() method is called. |
void |
stopRunningUntilStopState()
Sets a flag to break the loop in runUntilStopState(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateMachine(StateMachineDescription<S,I> stateMachineDescription, I inputSource)
Method Detail |
---|
public S getCurrentState()
public void goToNextState()
public void goToStateById(java.lang.String id)
id
- public void runUntilStopState()
public void stopRunningUntilStopState()
public void addStateEventListener(S state, StateEventListener<I> listener)
state
- listener
- public void removeStateEventListener(S state, StateEventListener<I> listener)
state
- listener
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |