|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.openai.util.fsm.State
State abstract class
Constructor Summary | |
State()
Constructs a new State. |
Method Summary | |
void |
addStateListener(StateListener listener)
Adds a StateListener to this State that we will deliver events to. |
void |
addTransition(Condition condition)
Adds a Condition to this State. |
void |
addTransition(Condition condition,
State targetState)
Convenience method for adding a transition from this state to the next. |
abstract void |
enter(java.lang.Object input)
This method is called when the state is entered. |
abstract java.lang.Object |
exit()
This method is called when the state is exited via a transition to another state. |
boolean |
getEndStateFlag()
Returns true if this state is an end state, false otherwise. |
java.lang.String |
getName()
Returns the name of this state. |
boolean |
getStartStateFlag()
Returns true if this state is a start state, false otherwise. |
java.util.Vector |
getTransitions()
Returns a Vector of the current Conditions/Transitions for this State. |
void |
removeStateListener(StateListener listener)
Removes a StateListener from this State. |
void |
removeTransition(Condition condition)
Removes a Condition as a Transition from this State. |
void |
setEndStateFlag(boolean endState)
Sets the value of this state's end state flag. |
void |
setName(java.lang.String name)
Sets the name for this state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public State()
Method Detail |
public final void setName(java.lang.String name)
NullPointerException
will be generated.
name
- The new name for this state.public final java.lang.String getName()
public final boolean getStartStateFlag()
public final void setEndStateFlag(boolean endState)
endState
- The new value of this state's end state flag.public final boolean getEndStateFlag()
public final void addStateListener(StateListener listener)
listener
- The StateListener to add.public final void removeStateListener(StateListener listener)
listener
- The StateListener to remove.public final void addTransition(Condition condition)
condition
- The new Condition to add.public final void addTransition(Condition condition, State targetState)
condition
- The new Condition to add.targetState
- The target state for this transition.public final void removeTransition(Condition condition)
condition
- The Condition/Transition to remove.public final java.util.Vector getTransitions()
public abstract void enter(java.lang.Object input)
input
- Any output from a previous state will become the input
for this state. If this is a start state, then
input
will be null
.public abstract java.lang.Object exit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |