oracle.cle.util.statemachine
Class TransitionTable
java.lang.Object
|
+--oracle.cle.util.statemachine.TransitionTable
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class TransitionTable
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Cloneable
Holds both the states(to,from) and the transitionConditions.
- See Also:
- Serialized Form
Field Summary |
protected boolean |
DEBUG
Set this to true for diagnostic messages |
Method Summary |
void |
addTransition(State from,
State to,
TransitionCondition condition)
|
java.lang.Object |
clone()
|
void |
debug(java.lang.String text)
a simple way to print some debug messages out |
java.lang.String |
getNextState(State from,
TransitionCondition condition)
public State getNextState(State from, TransitionCondition condition)
{
debug("Next State is: "
+ (State)(stateTable.get(generateStateKey(from, condition))));
return (State)(stateTable.get(generateStateKey(from, condition)));
} // end getNextState |
TransitionCondition |
getTransition(State from,
State to)
Returns the TransitionCondition for the specified to and from States. |
java.util.Vector |
getTransitionStatePairs()
Returns a Vector of State pairs (State[]) that, when taken
individually, represent the States involved in a Transition
in this TransitionTable. |
boolean |
isEmpty()
|
void |
removeTransition(State from,
State to)
|
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEBUG
protected boolean DEBUG
- Set this to true for diagnostic messages
TransitionTable
public TransitionTable()
getNextState
public java.lang.String getNextState(State from,
TransitionCondition condition)
- public State getNextState(State from, TransitionCondition condition)
{
debug("Next State is: "
+ (State)(stateTable.get(generateStateKey(from, condition))));
return (State)(stateTable.get(generateStateKey(from, condition)));
} // end getNextState
addTransition
public void addTransition(State from,
State to,
TransitionCondition condition)
removeTransition
public void removeTransition(State from,
State to)
getTransition
public TransitionCondition getTransition(State from,
State to)
- Returns the TransitionCondition for the specified to and from States.
isEmpty
public boolean isEmpty()
size
public int size()
getTransitionStatePairs
public java.util.Vector getTransitionStatePairs()
- Returns a Vector of State pairs (State[]) that, when taken
individually, represent the States involved in a Transition
in this TransitionTable.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
debug
public void debug(java.lang.String text)
- a simple way to print some debug messages out
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone
in class java.lang.Object
Copyright © 2003 ORACLE Corp. All Rights Reserved.