S - the type of the state of the FiniteStateMachinepublic class Transition<S extends Enum<S>> extends Object
Transition represents a transition in a FiniteStateMachine from one or more possible states to a desired state.| Constructor and Description |
|---|
Transition(String sName, EnumSet<S> statesFrom, S stateTo)
Constructs a
Transition (without an TransitionAction). |
Transition(String sName, EnumSet<S> statesFrom, S stateTo, TransitionAction<S> action)
Constructs a
Transition. |
Transition(String sName, S stateFrom, S stateTo)
Constructs a
Transition (without an TransitionAction). |
Transition(String sName, S stateFrom, S stateTo, TransitionAction<S> action)
Constructs a
Transition. |
| Modifier and Type | Method and Description |
|---|---|
TransitionAction<S> |
getAction()
Obtains the
TransitionAction to be performed for the Transition. |
S |
getEndingState()
Obtains the state to which the
FiniteStateMachine will be in once this Transition has occurred. |
String |
getName()
Obtains the name of the
Transition. |
boolean |
isStartingState(S state)
Determines if the specified state is one of the possible starting states for the
Transition. |
String |
toString() |
public Transition(String sName, EnumSet<S> statesFrom, S stateTo)
Transition (without an TransitionAction).sName - the name of the Transition (used for display and logging purposes)statesFrom - the set of states from which this Transition may occurstateTo - the state once the TransitionAction has been successfully performedpublic Transition(String sName, S stateFrom, S stateTo)
Transition (without an TransitionAction).sName - the name of the Transition (used for display and logging purposes)stateFrom - the state from which this Transition may occurstateTo - the state once the TransitionAction has been successfully performedpublic Transition(String sName, EnumSet<S> statesFrom, S stateTo, TransitionAction<S> action)
Transition.sName - the name of the Transition (used for display and logging purposes)statesFrom - the set of states from which this Transition may occurstateTo - the state once the TransitionAction has been successfully performedaction - the TransitionAction to be perform for the Transitionpublic Transition(String sName, S stateFrom, S stateTo, TransitionAction<S> action)
Transition.sName - the name of the Transition (used for display and logging purposes)stateFrom - the state from which this Transition may occurstateTo - the state once the TransitionAction has been successfully performedaction - the TransitionAction to be perform for the Transitionpublic String getName()
Transition.Transitionpublic boolean isStartingState(S state)
Transition.state - the state to checktrue if the specified state is one of the starting states for the Transitionpublic TransitionAction<S> getAction()
TransitionAction to be performed for the Transition.TransitionAction for the transitionpublic S getEndingState()
FiniteStateMachine will be in once this Transition has occurred.FiniteStateMachine after this Transition has occurred