Interface Transition
- All Known Implementing Classes:
AbstractTransition, MethodTransition, NoopTransition
public interface Transition
The interface implemented by classes which need to react on transitions
between states.
A Transition must implement two methods
- execute : a method called when we process the transition
- getNextState : a method that gives the next state for this transition
- An event ID : this defines the event this transition will accept
- A next state
-
Method Summary
-
Method Details
-
execute
Executes thisTransition. It is the responsibility of thisTransitionto determine whether it actually applies for the specifiedEvent. If thisTransitiondoesn't apply nothing should be executed andfalsemust be returned. The method will accept anyEventif it is registered with the wild card event ID ('*'), and the event ID it is declared for (ie, the event ID that has been passed as a parameter to this transition constructor.)- Parameters:
event- the currentEvent.- Returns:
trueif theTransitionwas executed,falseotherwise.
-
getNextState
State getNextState()- Returns:
- the
Statewhich theStateMachineshould move to if thisTransitionis taken andexecute(Event)returnstrue.nullif thisTransitionis a loopbackTransition.
-