|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--newstate.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.
Constructor Summary | |
FSM()
|
Method Summary | |
void |
addEvent(java.lang.String name)
This method can be used to add an event to the FSM. |
void |
addState(FSMAction entryAction,
java.lang.String statename)
This method can be used to add a state to the FSM. |
void |
addState(FSMAction entryAction,
java.lang.String statename,
FSMAction exitAction)
This method can be used to add a state to the FSM. |
void |
addState(java.lang.String statename)
This method can be used to add a state to the FSM. |
void |
addState(java.lang.String statename,
FSMAction exitAction)
This method can be used to add a state to the FSM. |
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. |
void |
setFirstState(java.lang.String statename)
This method is used to set the default state for the FSM. |
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 |
Constructor Detail |
public FSM()
Method Detail |
public void addState(java.lang.String statename)
statename
- The name of the statepublic void addState(FSMAction entryAction, java.lang.String statename)
entryAction
- The action that is executed upon state-entrystatename
- The name of the statepublic void addState(java.lang.String statename, FSMAction exitAction)
statename
- The name of the stateexitAction
- The action that is executed upon state-exitpublic void addState(FSMAction entryAction, java.lang.String statename, FSMAction exitAction)
entryAction
- The action that is executed upon state-entrystatename
- The name of the stateexitAction
- The action that is executed upon state-exitpublic 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 setFirstState(java.lang.String statename)
statename
- The name of the first action.public 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 |