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
ATransitionrepresents a transition in aFiniteStateMachinefrom 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 theTransitionActionto be performed for theTransition.SgetEndingState()Obtains the state to which theFiniteStateMachinewill be in once thisTransitionhas occurred.StringgetName()Obtains the name of theTransition.booleanisStartingState(S state)Determines if the specified state is one of the possible starting states for theTransition.StringtoString()
-
-
-
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 thisTransitionmay occurstateTo- the state once theTransitionActionhas 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 thisTransitionmay occurstateTo- the state once theTransitionActionhas 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 thisTransitionmay occurstateTo- the state once theTransitionActionhas been successfully performedaction- theTransitionActionto 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 thisTransitionmay occurstateTo- the state once theTransitionActionhas been successfully performedaction- theTransitionActionto 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:
trueif the specified state is one of the starting states for theTransition
-
getAction
public TransitionAction<S> getAction()
Obtains theTransitionActionto be performed for theTransition.- Returns:
- the
TransitionActionfor the transition
-
getEndingState
public S getEndingState()
Obtains the state to which theFiniteStateMachinewill be in once thisTransitionhas occurred.- Returns:
- the state of the
FiniteStateMachineafter thisTransitionhas occurred
-
-