org.xnap.util
Class FiniteStateMachine
java.lang.Object
org.xnap.util.AbstractStateMachine
org.xnap.util.FiniteStateMachine
public class FiniteStateMachine
- extends AbstractStateMachine
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FiniteStateMachine
public FiniteStateMachine(State initialState,
java.util.Hashtable successorsByState)
FiniteStateMachine
public FiniteStateMachine(State initialState)
putState
public void putState(State state,
java.util.HashSet successors)
canChange
protected void canChange(State oldState,
State newState)
- Description copied from class:
AbstractStateMachine
- Invoked when a state transition is attempted. Should throw an
exception if transistion is invalid.
- Specified by:
canChange
in class AbstractStateMachine
stateChanged
protected void stateChanged(State oldState,
State newState)
- Does nothing. Subclasses should overwrite this method.
- Specified by:
stateChanged
in class AbstractStateMachine
stateChangedFailed
protected void stateChangedFailed(State oldState,
State newState)
- Throws an IllegalOperationException. Subclasses can
overwrite this method.
- Throws:
IllegalOperationException
- thrown if the state transition
is not valid
createStateTable
public static java.util.Hashtable createStateTable(State[][] table)
Copyright © 2001-2005 XNap Team. All Rights Reserved.