Package com.tangosol.util.fsm
Class Transition<S extends Enum<S>>
- java.lang.Object
-
- com.tangosol.util.fsm.Transition<S>
-
- Type Parameters:
S
- the type of the state of theFiniteStateMachine
public class Transition<S extends Enum<S>> extends Object
ATransition
represents a transition in aFiniteStateMachine
from one or more possible states to a desired state.- Since:
- Coherence 12.2.1
- Author:
- Brian Oliver
-
-
Constructor Summary
Constructors Constructor Description Transition(String sName, EnumSet<S> statesFrom, S stateTo)
Constructs aTransition
(without anTransitionAction
).Transition(String sName, EnumSet<S> statesFrom, S stateTo, TransitionAction<S> action)
Constructs aTransition
.Transition(String sName, S stateFrom, S stateTo)
Constructs aTransition
(without anTransitionAction
).Transition(String sName, S stateFrom, S stateTo, TransitionAction<S> action)
Constructs aTransition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransitionAction<S>
getAction()
Obtains theTransitionAction
to be performed for theTransition
.S
getEndingState()
Obtains the state to which theFiniteStateMachine
will be in once thisTransition
has occurred.String
getName()
Obtains the name of theTransition
.boolean
isStartingState(S state)
Determines if the specified state is one of the possible starting states for theTransition
.String
toString()
-
-
-
Constructor Detail
-
Transition
public Transition(String sName, EnumSet<S> statesFrom, S stateTo)
Constructs aTransition
(without anTransitionAction
).- Parameters:
sName
- the name of theTransition
(used for display and logging purposes)statesFrom
- the set of states from which thisTransition
may occurstateTo
- the state once theTransitionAction
has been successfully performed
-
Transition
public Transition(String sName, S stateFrom, S stateTo)
Constructs aTransition
(without anTransitionAction
).- Parameters:
sName
- the name of theTransition
(used for display and logging purposes)stateFrom
- the state from which thisTransition
may occurstateTo
- the state once theTransitionAction
has been successfully performed
-
Transition
public Transition(String sName, EnumSet<S> statesFrom, S stateTo, TransitionAction<S> action)
Constructs aTransition
.- Parameters:
sName
- the name of theTransition
(used for display and logging purposes)statesFrom
- the set of states from which thisTransition
may occurstateTo
- the state once theTransitionAction
has been successfully performedaction
- theTransitionAction
to be perform for theTransition
-
Transition
public Transition(String sName, S stateFrom, S stateTo, TransitionAction<S> action)
Constructs aTransition
.- Parameters:
sName
- the name of theTransition
(used for display and logging purposes)stateFrom
- the state from which thisTransition
may occurstateTo
- the state once theTransitionAction
has been successfully performedaction
- theTransitionAction
to be perform for theTransition
-
-
Method Detail
-
getName
public String getName()
Obtains the name of theTransition
.- Returns:
- the name of the
Transition
-
isStartingState
public boolean isStartingState(S state)
Determines if the specified state is one of the possible starting states for theTransition
.- Parameters:
state
- the state to check- Returns:
true
if the specified state is one of the starting states for theTransition
-
getAction
public TransitionAction<S> getAction()
Obtains theTransitionAction
to be performed for theTransition
.- Returns:
- the
TransitionAction
for the transition
-
getEndingState
public S getEndingState()
Obtains the state to which theFiniteStateMachine
will be in once thisTransition
has occurred.- Returns:
- the state of the
FiniteStateMachine
after thisTransition
has occurred
-
-