|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--nestedstate.FSM
This class serves as a access point for the whole framework. An FSM object encapsulates a FSM and provides a factory method to create a FSMContext object for this FSM.
| Field Summary | |
static java.lang.String |
ROOT
|
| Constructor Summary | |
FSM()
Initialize the FSM: create a root NodeState. |
|
| Method Summary | |
void |
addEvent(java.lang.String name)
This method can be used to add an event to the FSM. |
void |
addLeafState(FSMAction entryAction,
java.lang.String statename,
FSMAction exitAction,
java.lang.String parentstate)
Add a leafstate. |
void |
addLeafState(FSMAction entryAction,
java.lang.String statename,
java.lang.String parentstate)
Add a leafstate. |
void |
addLeafState(java.lang.String statename,
FSMAction exitAction,
java.lang.String parentstate)
Add a leafstate. |
void |
addLeafState(java.lang.String statename,
java.lang.String parentstate)
Add a leafstate. |
void |
addNodeState(java.lang.String statename,
java.lang.String parentstate)
Add a nodestate. |
void |
addTransition(java.lang.String sourcestate,
java.lang.String eventname,
java.lang.String targetstate,
FSMAction action)
This method creates a transition between the sourcestate and the target state. |
FSMContext |
createFSMInstance()
This method serves as a factory method to create FSMContexts from the FSM. |
NodeState |
getRoot()
|
State |
getStateWithName(java.lang.String name)
Convenience method. |
void |
setDefaultState(java.lang.String state)
Set the default state for the root state. |
void |
setDefaultState(java.lang.String parent,
java.lang.String state)
Set the default state for a nodestate. |
void |
setInitAction(FSMAction action)
Sometimes it's necessary to do some initialization before the FSM can be used. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static java.lang.String ROOT
| Constructor Detail |
public FSM()
| Method Detail |
public NodeState getRoot()
public void addLeafState(java.lang.String statename,
java.lang.String parentstate)
statename - The name of this stateparentstate - The name of the parent state. If left null, the state will
be added to the root state.
public void addLeafState(FSMAction entryAction,
java.lang.String statename,
java.lang.String parentstate)
statename - The name of this stateparentstate - The name of the parent state. If left null, the state will
be added to the root state.
public void addLeafState(java.lang.String statename,
FSMAction exitAction,
java.lang.String parentstate)
statename - The name of this stateexitAction - The action that is executed upon state-exitparentstate - The name of the parent state. If left null, the state will
be added to the root state.
public void addLeafState(FSMAction entryAction,
java.lang.String statename,
FSMAction exitAction,
java.lang.String parentstate)
entryAction - The action that is executed upon state-entrystatename - The name of the stateexitAction - The action that is executed upon state-exitparentstate - The name of the parent state. If left null, the state will
be added to the root state.
public void addNodeState(java.lang.String statename,
java.lang.String parentstate)
statename - The name of the stateparentstate - The name of the parent state. If left null, the state will
be added to the root state.public void addEvent(java.lang.String name)
name - This is the name of the event.
public void addTransition(java.lang.String sourcestate,
java.lang.String eventname,
java.lang.String targetstate,
FSMAction action)
sourcestate - The name of the sourcestateeventname - The name of the event that triggers the transitiontargetstate - the name of the targetstateaction - The action that will be executed when the transition
is triggered.public void setDefaultState(java.lang.String state)
public void setDefaultState(java.lang.String parent,
java.lang.String state)
parent - The nodestatestate - The default statepublic State getStateWithName(java.lang.String name)
name - The name of the statepublic void setInitAction(FSMAction action)
action - The initial action.public FSMContext createFSMInstance()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||