public class StateMachine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected State |
currentState
The current state that will receive the next event.
|
protected State |
resetState
The state to go to whan all is bad.
|
protected java.util.Vector |
states
The states to track.
|
Constructor and Description |
---|
StateMachine() |
StateMachine(State[] s)
Define the state machine using the array of states.
|
Modifier and Type | Method and Description |
---|---|
void |
addStates(State[] s)
Append States to the state Vector.
|
State |
getResetState()
Return the reset state.
|
State |
getState()
Return the current State.
|
State |
getState(int stateIndex)
Return the state at the given index.
|
java.util.Vector |
getStates()
Get the Vector of States.
|
void |
reset()
Sets the current state to the reset state.
|
void |
setMapMouseListenerResponses(boolean value)
Set the MapMouseListenerResponse for all the states.
|
void |
setResetState(int stateIndex)
Set the reset state to be used by the state machine.
|
void |
setResetState(State state)
Set the state to be gone to if the state machine is reset.
|
void |
setState(int stateIndex)
Set the current state to the state residing in the vector at
the given index.
|
void |
setState(State state)
Set the current state to the given state.
|
void |
setStateAt(int stateIndex,
State state)
Set the state at an index to new State Object.
|
void |
setStates(State[] s)
Set the states to the new array.
|
void |
setStates(java.util.Vector s)
Set the states to the vector of States.
|
protected java.util.Vector states
protected State currentState
protected State resetState
public StateMachine()
public StateMachine(State[] s)
s
- array of states.public void reset()
public void setStates(State[] s)
s
- array of states.public void setStates(java.util.Vector s)
s
- public java.util.Vector getStates()
public void addStates(State[] s)
s
- an Array of States.public void setState(State state)
state
- the state to set to the current one.public void setState(int stateIndex)
stateIndex
- the index of the current state.public void setStateAt(int stateIndex, State state)
stateIndex
- state
- public State getState()
public State getState(int stateIndex)
public void setResetState(State state)
public void setResetState(int stateIndex)
public State getResetState()
public void setMapMouseListenerResponses(boolean value)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details