Package org.glassfish.pfl.basic.fsm
Class State
java.lang.Object
org.glassfish.pfl.basic.fsm.NameBase
org.glassfish.pfl.basic.fsm.State
Base class for all states in a StateEngine. This must be used
as the base class for all states in transitions added to a StateEngine.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Action
private State
private Map
<Input, Set<Transition>> private Map
<Input, Set<Transition>> private Map
<Input, Set<Transition>> private State.Kind
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addTransition
(Input in, Transition ga) Get the default transition action that is used if the default next state is used.Return the default next state for this state.getKind()
Return the Kind of this state.(package private) Set
<Transition> getTransitions
(Input in) void
postAction
(FSM fsm) Method that defines action that occurs whenever this state is exited, that is, when the state is changed from this state to a new state.Method that defines action that occurs whenever this state is entered from a different state.returnAction
(FSM fsm, FSM nestedFSM) If this state has Kind REFERENCE, and its preAction pushes a nested FSM onto the stack, the returnAction method is called after the nested FSM reaches a final state.(package private) void
setDefaultAction
(Action defaultAction) (package private) void
setDefaultNextState
(State defaultNextState)
-
Field Details
-
kind
-
defaultAction
-
defaultNextState
-
inputMap
-
inputMapRangeImage
-
inputMapImage
-
-
Constructor Details
-
State
-
State
-
State
-
State
-
-
Method Details
-
getKind
Return the Kind of this state. -
preAction
Method that defines action that occurs whenever this state is entered from a different state. preAction is not called on a self-transition. If preAction returns a non-null result, the result becomes the current FSM.Any exceptions except ThreadDeath thrown by this method are ignored. This method can be overridden in a state implementation if needed.
-
returnAction
If this state has Kind REFERENCE, and its preAction pushes a nested FSM onto the stack, the returnAction method is called after the nested FSM reaches a final state. The nested FSM is passed into nestedFSM, and fsm is the new top of stack, which is the FSM that was active when the preAction was called. The result is the new state that will be assumed after this REFERENCE's state postAction method is called.If the returnAction method sets the state to a new state, the postAction method is called as usuTransition.
Any exceptions except ThreadDeath thrown by this method are ignored. This method can be overridden in a state implementation if needed.
-
postAction
Method that defines action that occurs whenever this state is exited, that is, when the state is changed from this state to a new state.Any exceptions except ThreadDeath thrown by this method are ignored. This method can be overridden in a state implementation if needed.
-
getDefaultNextState
Return the default next state for this state. This is the next state if the input is not found in the action map. -
getDefaultAction
Get the default transition action that is used if the default next state is used. -
getInputMap
-
setDefaultNextState
-
setDefaultAction
-
addTransition
-
getTransitions
-