Constructor and Description |
---|
StateMachine(Set states,
State startState)
Create a state machine given its states and start state.
|
StateMachine(Set states,
State startState,
String description)
Create a state machine given its states and start state.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Make a copy of the StateMachine maintaining the current state.
|
State |
getCurrentState()
Get the current state of the state machine.
|
String |
getDescription()
Get the state machine description.
|
State |
getStartState()
Get the start state of the state machine.
|
Set |
getStates()
Get the states of the state machine.
|
State |
nextState(String actionName)
Transition to the next state given the name of a valid transition.
|
State |
reset()
Reset the state machine back to the start state
|
String |
toString() |
public StateMachine(Set states, State startState)
states
- - SetstartState
- - the starting statepublic Object clone()
public String getDescription()
public State getCurrentState()
public State getStartState()
public Set getStates()
public State nextState(String actionName) throws IllegalTransitionException
actionName
- - the name of transition that is valid for the
current state.IllegalTransitionException
public State reset()
Copyright © 2021 JBoss by Red Hat. All rights reserved.