public enum State extends Enum<State>
The state transition diagram is as follows:
+--[a]--> W --[b]--> Y --[e]---+
| ^ |
Initial-+ | |
| | +--> (Z)-----[g]---> Terminal
+--[c]--> X --[b]----+ |
| |
+--------[d]---------+
| 枚举常量和说明 |
|---|
Initial
The initial state from which all state sequences start.
|
InvalidTransition
Special state returned by the State.transition(...) function when attempting
an illegal state transition.
|
Terminal
The terminal state in the state machine.
|
W
State 'W'.
|
X
State 'X'.
|
Y
State 'Y'.
|
Z
State 'Z'.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isTerminal()
Checks if this state is a terminal state.
|
EventType |
randomInvalidTransition(Random rnd)
Returns an event type that, if applied as a transition on this state, will result
in an illegal state transition.
|
EventTypeAndState |
randomTransition(Random rnd)
Picks a random transition, based on the probabilities of the outgoing transitions
of this state.
|
State |
transition(EventType evt)
Gets the state after transitioning from this state based on the given event.
|
static State |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static State[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final State Terminal
public static final State InvalidTransition
public static final State Z
public static final State Y
public static final State X
public static final State W
public static final State Initial
public static State[] values()
for (State c : State.values()) System.out.println(c);
public static State valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public boolean isTerminal()
public State transition(EventType evt)
evt - The event that defined the transition.public EventTypeAndState randomTransition(Random rnd)
rnd - The random number generator to use.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.