org.progeeks.fsm
Class ForwardingTransitionHandler
java.lang.Object
org.progeeks.fsm.TransitionHandler
org.progeeks.fsm.ForwardingTransitionHandler
- All Implemented Interfaces:
- StateHandler
public class ForwardingTransitionHandler
- extends TransitionHandler
A transition handler subclass that will forward to a specified
delegate StateHandler before returning it's internal state value.
This is useful for wrapping an existing StateHandler but providing
a different state transition.
- Version:
- $Revision: 1.1 $
- Author:
- Paul Speed
Constructor Summary |
ForwardingTransitionHandler(int stateTransition,
StateHandler delegate)
Creates a new state handler that will foward processing to the
specified delegate state handler before returning the specified
state transition value. |
Method Summary |
int |
handleMessage(int state,
int message,
java.lang.Object stateInfo)
Calls the delegate's handleMessage() method before calling the
super.handleMessage() method. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ForwardingTransitionHandler
public ForwardingTransitionHandler(int stateTransition,
StateHandler delegate)
- Creates a new state handler that will foward processing to the
specified delegate state handler before returning the specified
state transition value.
handleMessage
public int handleMessage(int state,
int message,
java.lang.Object stateInfo)
- Calls the delegate's handleMessage() method before calling the
super.handleMessage() method.
- Specified by:
handleMessage
in interface StateHandler
- Overrides:
handleMessage
in class TransitionHandler
- Parameters:
state
- The current state the called this handler.message
- The numeric message to be handled.stateInfo
- The application specific data on which the handler
can operate if necessary.
toString
public java.lang.String toString()
- Overrides:
toString
in class TransitionHandler
Copyright © 2002-2003 Paul Speed. All Rights Reserved.