public abstract class AbstractTransition extends Object implements Transition
Transition implementation. Takes care of matching the
current Event's id against the id of the Event this
Transition handles. To handle any Event the id should be set
to Event.WILDCARD_EVENT_ID.| Constructor and Description |
|---|
AbstractTransition()
|
AbstractTransition(Object eventId)
|
AbstractTransition(Object eventId,
State nextState)
|
AbstractTransition(State nextState)
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
doExecute(Event event)
Executes this
Transition. |
boolean |
equals(Object o) |
boolean |
execute(Event event)
Executes this
Transition. |
State |
getNextState() |
int |
hashCode() |
String |
toString() |
public AbstractTransition(State nextState)
nextState - the next State.public AbstractTransition()
public State getNextState()
getNextState in interface TransitionState which the StateMachine should move to
if this Transition is taken and Transition.execute(Event) returns
true. null if this Transition is a loopback
Transition.public boolean execute(Event event)
Transition. It is the responsibility of this
Transition to determine whether it actually applies for the
specified Event. If this Transition doesn't apply
nothing should be executed and false must be returned.
The method will accept any Event if 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.)execute in interface Transitionevent - the current Event.true if the Transition was executed,
false otherwise.protected abstract boolean doExecute(Event event)
Transition. This method doesn't have to check
if the Event's id matches because execute(Event) has
already made sure that that is the case.event - the current Event.true if the Transition has been executed
successfully and the StateMachine should move to the
next State. false otherwise.Copyright © 2004–2023 Apache MINA Project. All rights reserved.