|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cle.util.statemachine.StateMachine
A (Deterministic) Finite State Machine (FSM) contains:
1. A set of States
2. A transition table (function)
3. A single begin state that is a member of the set of states
4. A set of end states that is a subset of the set of states
(NOTE: We will implement this at the State level, not the
machine level).
State
, Serialized FormField Summary | |
protected java.lang.String |
currentState
The single state that this FSM is currently in |
protected boolean |
DEBUG
Set this to true for diagnostic messages |
protected java.lang.String |
initialState
The single initial state for this FSM |
protected java.util.Vector |
states
The set of states in this FSM |
protected java.util.Stack |
stateStack
The history of this FSM |
protected TransitionTable |
transitionTable
The transition table function for this FSM |
Constructor Summary | |
StateMachine()
Default Constructor |
|
StateMachine(java.util.Vector stateList,
State anInitialState)
Constructor which sets the states and the begin state for the FSM |
|
StateMachine(java.util.Vector stateList,
State anInitialState,
TransitionTable aTransitionTable)
Constructor which sets the states and the begin state for the FSM |
Method Summary | |
java.lang.Object |
clone()
|
void |
debug(java.lang.String text)
a simple way to print some debug messages out |
java.lang.String |
dumpStateStack()
Prints a history of the state machine to a String |
State |
findState(java.lang.String stateName)
|
State |
getCurrentState()
|
State |
getInitialState()
|
protected State |
getStateGivenItsName(java.lang.String stateName)
|
java.util.Vector |
getStates()
|
TransitionTable |
getTransitionTable()
|
void |
setInitialState(State aState)
|
void |
setStates(java.util.Vector aVector)
|
void |
setTransitionTable(TransitionTable table)
|
void |
start()
Begins the execution of this State Machine |
void |
start(State anInitialState)
Begins the execution of this State Machine in the specified state |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector states
protected TransitionTable transitionTable
protected java.lang.String initialState
protected java.lang.String currentState
protected java.util.Stack stateStack
protected boolean DEBUG
Constructor Detail |
public StateMachine()
public StateMachine(java.util.Vector stateList, State anInitialState)
public StateMachine(java.util.Vector stateList, State anInitialState, TransitionTable aTransitionTable)
Method Detail |
public void start()
public void start(State anInitialState)
public void setInitialState(State aState)
public State getInitialState()
public void setStates(java.util.Vector aVector)
public java.util.Vector getStates()
public TransitionTable getTransitionTable()
public void setTransitionTable(TransitionTable table)
public State getCurrentState()
public java.lang.String dumpStateStack()
public void debug(java.lang.String text)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
public State findState(java.lang.String stateName)
protected State getStateGivenItsName(java.lang.String stateName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |