public class StateMachineEventAdapter extends java.lang.Object implements StateMachineEventListener
An abstract adapter class for receiving state machine events. The methods in this class are empty. This class exists as convenience for creating listener objects.
State machine events let you track when a state machine is reset, resumed, suspended or when a state machine passed a transition leading it to a new state or letting it in the current state.
Extend this class to create a StateMachineEvent listener and override the methods for the events of interest. (If you implement the StateMachineEventListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)
Create a listener object using the extended class and then register it with a state machine using the state machine's addSMListener method. When the state machine is attached, detached, resumed, reset, suspended, goes to another state or loops on the current state, the relevant method in the listener object is invoked and the StateMachineEvent is passed to it.
StateMachineEvent
,
StateMachineEventListener
Constructor and Description |
---|
StateMachineEventAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
smInited(StateMachineEvent e)
Invoked when the state machine has been inited.
|
void |
smReset(StateMachineEvent e)
Invoked when the state machine has been reset.
|
void |
smResumed(StateMachineEvent e)
Invoked when the state machine has been resumed.
|
void |
smStateChanged(StateMachineEvent e)
Invoked when the state machine has fired a transition changing the current state.
|
void |
smStateLooped(StateMachineEvent e)
Invoked when the state machine has fired a transition making it loop on the current state.
|
void |
smSuspended(StateMachineEvent e)
Invoked when the state machine has been suspended.
|
public void smSuspended(StateMachineEvent e)
smSuspended
in interface StateMachineEventListener
e
- the event.public void smResumed(StateMachineEvent e)
smResumed
in interface StateMachineEventListener
e
- the event.public void smReset(StateMachineEvent e)
smReset
in interface StateMachineEventListener
e
- the event.public void smStateChanged(StateMachineEvent e)
smStateChanged
in interface StateMachineEventListener
e
- the event.public void smStateLooped(StateMachineEvent e)
smStateLooped
in interface StateMachineEventListener
e
- the event.public void smInited(StateMachineEvent e)
smInited
in interface StateMachineEventListener
e
- the event.