|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.statemachine.transition.AbstractTransition
public abstract class AbstractTransition
Abstract 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 Summary | |
|---|---|
AbstractTransition(Object eventId)
Creates a new instance which will loopback to the same State
for the specified Event id. |
|
AbstractTransition(Object eventId,
State nextState)
Creates a new instance with the specified State as next state
and for the specified Event id. |
|
| Method Summary | |
|---|---|
protected abstract boolean |
doExecute(Event event)
Executes this Transition. |
boolean |
equals(Object o)
|
boolean |
execute(Event event)
Executes this Transition. |
State |
getNextState()
Returns the State which the StateMachine should move to
if this Transition is taken and Transition.execute(Event) returns
true. |
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTransition(Object eventId)
State
for the specified Event id.
eventId - the Event id.
public AbstractTransition(Object eventId,
State nextState)
State as next state
and for the specified Event id.
eventId - the Event id.nextState - the next State.| Method Detail |
|---|
public State getNextState()
TransitionState which the StateMachine should move to
if this Transition is taken and Transition.execute(Event) returns
true.
getNextState in interface TransitionState or null if this
Transition is a loopback Transition.public boolean execute(Event event)
TransitionTransition. 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.
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.public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||