public class StateControl
extends java.lang.Object
The *Now()
family of methods move to a new State
immediately and let the new State
handle the current Event
.
The *Next()
family on the other hand let the new State
handle the next Event
which is generated which make these method the
programmatic equivalent of using the Transition
annotation.
Using the breakAndCall*()
and breakAndReturn*
methods one
can create sub state machines which behave very much like sub routines.
When calling a state the current state (or the specified returnTo
state) will be pushed on a stack. When returning from a state the last pushed
state will be popped from the stack and used as the new state.
构造器和说明 |
---|
StateControl() |
限定符和类型 | 方法和说明 |
---|---|
static void |
breakAndCallNext(java.lang.String state)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the next Event . |
static void |
breakAndCallNext(java.lang.String state,
java.lang.String returnTo)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the next Event . |
static void |
breakAndCallNow(java.lang.String state)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the current Event . |
static void |
breakAndCallNow(java.lang.String state,
java.lang.String returnTo)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the current Event . |
static void |
breakAndContinue()
Breaks the execution of the current
Transition and tries to
find another Transition with higher weight or a Transition
of a parent State which can handle the current Event . |
static void |
breakAndGotoNext(java.lang.String state)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the next Event . |
static void |
breakAndGotoNow(java.lang.String state)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the current Event . |
static void |
breakAndReturnNext()
Breaks the execution of the current
Transition and lets the
last recorded State handle the next Event . |
static void |
breakAndReturnNow()
Breaks the execution of the current
Transition and lets the
last recorded State handle the current Event . |
public static void breakAndContinue()
Transition
and tries to
find another Transition
with higher weight or a Transition
of a parent State
which can handle the current Event
.public static void breakAndGotoNow(java.lang.String state)
Transition
and lets the
State
with the specified id handle the current Event
.state
- the id of the State
to go to.public static void breakAndGotoNext(java.lang.String state)
Transition
and lets the
State
with the specified id handle the next Event
.
Using this method is the programmatic equivalent of using the
Transition
annotation.state
- the id of the State
to go to.public static void breakAndCallNow(java.lang.String state)
Transition
and lets the
State
with the specified id handle the current Event
.
Before moving to the new state the current state will be recorded. The
next call to breakAndReturnNow()
or breakAndReturnNext()
will return to the current state.state
- the id of the State
to call.public static void breakAndCallNext(java.lang.String state)
Transition
and lets the
State
with the specified id handle the next Event
.
Before moving to the new state the current state will be recorded. The
next call to breakAndReturnNow()
or breakAndReturnNext()
will return to the current state.state
- the id of the State
to call.public static void breakAndCallNow(java.lang.String state, java.lang.String returnTo)
Transition
and lets the
State
with the specified id handle the current Event
.
Before moving to the new state the current state will be recorded. The
next call to breakAndReturnNow()
or breakAndReturnNext()
will return to the specified returnTo
state.public static void breakAndCallNext(java.lang.String state, java.lang.String returnTo)
Transition
and lets the
State
with the specified id handle the next Event
.
Before moving to the new state the current state will be recorded. The
next call to breakAndReturnNow()
or breakAndReturnNext()
will return to the specified returnTo
state.public static void breakAndReturnNow()
Transition
and lets the
last recorded State
handle the current Event
.public static void breakAndReturnNext()
Transition
and lets the
last recorded State
handle the next Event
.