S - the type of stateE - the type of eventpublic abstract class AbstractState<S,E> extends java.lang.Object implements State<S,E>
State.| Constructor and Description |
|---|
AbstractState(S id,
java.util.Collection<E> deferred)
Instantiates a new abstract state.
|
AbstractState(S id,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions)
Instantiates a new abstract state.
|
AbstractState(S id,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions,
PseudoState<S,E> pseudoState)
Instantiates a new abstract state.
|
AbstractState(S id,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions,
PseudoState<S,E> pseudoState,
java.util.Collection<Region<S,E>> regions)
Instantiates a new abstract state.
|
AbstractState(S id,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions,
PseudoState<S,E> pseudoState,
StateMachine<S,E> submachine)
Instantiates a new abstract state.
|
AbstractState(S id,
PseudoState<S,E> pseudoState)
Instantiates a new abstract state.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
entry(StateContext<S,E> context)
Initiate an entry sequence for the state.
|
abstract void |
exit(StateContext<S,E> context)
Initiate an exit sequence for the state.
|
java.util.Collection<E> |
getDeferredEvents()
Gets the deferred events for this state.
|
java.util.Collection<? extends Action<S,E>> |
getEntryActions()
Gets
Actions executed entering in this state. |
java.util.Collection<? extends Action<S,E>> |
getExitActions()
Gets
Actions executed exiting from this state. |
S |
getId()
Gets the state identifier.
|
abstract java.util.Collection<S> |
getIds()
Gets the state identifiers.
|
PseudoState<S,E> |
getPseudoState()
Gets a
PseudoState attached to a State. |
java.util.Collection<Region<S,E>> |
getRegions()
Gets the regions.
|
abstract java.util.Collection<State<S,E>> |
getStates()
Gets all possible states this state knows about including itself
and substates.
|
StateMachine<S,E> |
getSubmachine()
Gets the submachine.
|
boolean |
isComposite()
Checks if state is a composite state.
|
boolean |
isOrthogonal()
Checks if state is an orthogonal state.
|
boolean |
isSimple()
Checks if state is a simple state.
|
boolean |
isSubmachineState()
Checks if state is a submachine state.
|
boolean |
sendEvent(org.springframework.messaging.Message<E> event)
Send an event
E wrapped with a Message to the state. |
java.lang.String |
toString() |
public AbstractState(S id, PseudoState<S,E> pseudoState)
id - the state identifierpseudoState - the pseudo statepublic AbstractState(S id, java.util.Collection<E> deferred)
id - the state identifierdeferred - the deferredpublic AbstractState(S id, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions)
id - the state identifierdeferred - the deferredentryActions - the entry actionsexitActions - the exit actionspublic AbstractState(S id, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions, PseudoState<S,E> pseudoState)
id - the state identifierdeferred - the deferredentryActions - the entry actionsexitActions - the exit actionspseudoState - the pseudo statepublic AbstractState(S id, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions, PseudoState<S,E> pseudoState, StateMachine<S,E> submachine)
id - the state identifierdeferred - the deferredentryActions - the entry actionsexitActions - the exit actionspseudoState - the pseudo statesubmachine - the submachinepublic AbstractState(S id, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions, PseudoState<S,E> pseudoState, java.util.Collection<Region<S,E>> regions)
id - the state identifierdeferred - the deferredentryActions - the entry actionsexitActions - the exit actionspseudoState - the pseudo stateregions - the regionspublic boolean sendEvent(org.springframework.messaging.Message<E> event)
StateE wrapped with a Message to the state.public abstract void exit(StateContext<S,E> context)
Statepublic abstract void entry(StateContext<S,E> context)
Statepublic abstract java.util.Collection<S> getIds()
Statepublic abstract java.util.Collection<State<S,E>> getStates()
Statepublic PseudoState<S,E> getPseudoState()
StatePseudoState attached to a State.
PseudoState is not required and thus this method return
NULL if it's not set.getPseudoState in interface State<S,E>public java.util.Collection<E> getDeferredEvents()
StategetDeferredEvents in interface State<S,E>public java.util.Collection<? extends Action<S,E>> getEntryActions()
StateActions executed entering in this state.getEntryActions in interface State<S,E>public java.util.Collection<? extends Action<S,E>> getExitActions()
StateActions executed exiting from this state.getExitActions in interface State<S,E>public boolean isComposite()
StateisComposite in interface State<S,E>public boolean isOrthogonal()
StateTRUE,
State.isComposite() will also always return TRUE.isOrthogonal in interface State<S,E>public boolean isSimple()
Statepublic boolean isSubmachineState()
StateisSubmachineState in interface State<S,E>public StateMachine<S,E> getSubmachine()
public java.util.Collection<Region<S,E>> getRegions()
public java.lang.String toString()
toString in class java.lang.Object