Package com.tangosol.util.fsm
Class SimpleModel<S extends Enum<S>>
java.lang.Object
com.tangosol.util.fsm.SimpleModel<S>
- Type Parameters:
S- the type of state
- All Implemented Interfaces:
Model<S>
- Author:
- Brian Oliver
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleModel(Class<S> stateClass) Constructs aSimpleModelgiven an Enum of the possible states of aFiniteStateMachine. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStateEntryAction(S state, StateEntryAction<S> stateEntryAction) Adds/overrides theStateEntryActionfor the specified state in theModel.voidaddStateExitAction(S state, StateExitAction<S> stateExitAction) Adds/overrides theStateExitActionfor the specified state in theModel.voidaddTransition(Transition<S> transition) Adds the specifiedTransitionto theModel.Obtains the state with the specified name from theSimpleModel.Obtains theStateEntryActions defined for the states in theModel.Map<S, StateExitAction<S>> Obtains theStateExitActions defined for the states in theModel.S[]Obtains the valid states defined by theModel.Obtains theTransitions defined by theModel.
-
Constructor Details
-
SimpleModel
Constructs aSimpleModelgiven an Enum of the possible states of aFiniteStateMachine.- Parameters:
stateClass- the Enum class containing the possible states
-
-
Method Details
-
getStateClass
-
getStates
Obtains the valid states defined by theModel. -
getStateEntryActions
Obtains theStateEntryActions defined for the states in theModel.- Specified by:
getStateEntryActionsin interfaceModel<S extends Enum<S>>- Returns:
- the defined
StateEntryActions defined for the states in theModel
-
addStateEntryAction
Adds/overrides theStateEntryActionfor the specified state in theModel.- Parameters:
state- the statestateEntryAction- theStateEntryActionfor the state
-
getStateExitActions
Obtains theStateExitActions defined for the states in theModel.- Specified by:
getStateExitActionsin interfaceModel<S extends Enum<S>>- Returns:
- the defined
StateExitActions defined for the states in theModel
-
getTransitions
Obtains theTransitions defined by theModel.- Specified by:
getTransitionsin interfaceModel<S extends Enum<S>>- Returns:
- the
Transitions defined by theModel
-
getState
Obtains the state with the specified name from theSimpleModel.- Parameters:
sName- the name of the state to obtain- Returns:
- the state with the specified name or
nullif no such state is known by theSimpleModel
-
addStateExitAction
Adds/overrides theStateExitActionfor the specified state in theModel.- Parameters:
state- the statestateExitAction- theStateExitActionfor the state
-
addTransition
Adds the specifiedTransitionto theModel.- Parameters:
transition- theTransitionto add
-