org.squirrelframework.foundation.fsm
Interface ImmutableState<T extends StateMachine<T,S,E,C>,S,E,C>

Type Parameters:
T - type of State Machine
S - type of State
E - type of Event
C - type of Context
All Superinterfaces:
SquirrelComponent, Visitable
All Known Subinterfaces:
ImmutableLinkedState<T,S,E,C>, ImmutableTimedState<T,S,E,C>, MutableLinkedState<T,S,E,C>, MutableState<T,S,E,C>, MutableTimedState<T,S,E,C>, UntypedImmutableState, UntypedMutableState
All Known Implementing Classes:
TimedStateImpl

public interface ImmutableState<T extends StateMachine<T,S,E,C>,S,E,C>
extends Visitable, SquirrelComponent

State The basic unit that composes a state machine. A state machine can be in one state at any particular time.

Entry Action An activity executed when entering the state

Entry Action An activity executed when entering the state

Final State A state which represents the completion of the state machine.

Author:
Henry.He

Method Summary
 ImmutableState<T,S,E,C> enterByHistory(StateContext<T,S,E,C> stateContext)
          Enters this state by its history depending on its HistoryType.
 ImmutableState<T,S,E,C> enterDeep(StateContext<T,S,E,C> stateContext)
          Enters this state is deep mode: mode if there is one.
 ImmutableState<T,S,E,C> enterShallow(StateContext<T,S,E,C> stateContext)
          Enters this state is shallow mode: The entry action is executed and the initial state is entered in shallow mode if there is one.
 void entry(StateContext<T,S,E,C> stateContext)
          Entry state with state context
 void exit(StateContext<T,S,E,C> stateContext)
          Exit state with state context
 Set<E> getAcceptableEvents()
           
 List<ImmutableTransition<T,S,E,C>> getAllTransitions()
           
 List<ImmutableState<T,S,E,C>> getChildStates()
           
 StateCompositeType getCompositeType()
           
 List<Action<T,S,E,C>> getEntryActions()
           
 List<Action<T,S,E,C>> getExitActions()
           
 HistoryType getHistoryType()
           
 ImmutableState<T,S,E,C> getInitialState()
           
 int getLevel()
           
 ImmutableState<T,S,E,C> getParentState()
           
 String getPath()
           
 S getStateId()
           
 ImmutableState<T,S,E,C> getThis()
           
 List<ImmutableTransition<T,S,E,C>> getTransitions(E event)
           
 boolean hasChildStates()
           
 void internalFire(StateContext<T,S,E,C> stateContext)
          Notify transitions when receiving event.
 boolean isFinalState()
           
 boolean isParallelState()
           
 boolean isRegion()
           
 boolean isRootState()
           
 void verify()
          Verify state correctness
 
Methods inherited from interface org.squirrelframework.foundation.fsm.Visitable
accept
 

Method Detail

getStateId

S getStateId()
Returns:
state id

isRootState

boolean isRootState()
Returns:
whether state is root state

getEntryActions

List<Action<T,S,E,C>> getEntryActions()
Returns:
Activities executed when entering the state

getExitActions

List<Action<T,S,E,C>> getExitActions()
Returns:
Activities executed when exiting the state

getAllTransitions

List<ImmutableTransition<T,S,E,C>> getAllTransitions()
Returns:
All transitions start from this state

getTransitions

List<ImmutableTransition<T,S,E,C>> getTransitions(E event)
Parameters:
event -
Returns:
Transitions triggered by event

getAcceptableEvents

Set<E> getAcceptableEvents()
Returns:
events that can be accepted by this state

entry

void entry(StateContext<T,S,E,C> stateContext)
Entry state with state context

Parameters:
stateContext -

enterByHistory

ImmutableState<T,S,E,C> enterByHistory(StateContext<T,S,E,C> stateContext)
Enters this state by its history depending on its HistoryType. The Entry method has to be called already.

Parameters:
stateContext - the state context.
Returns:
the active state. (depends on this statesHistoryType)

enterDeep

ImmutableState<T,S,E,C> enterDeep(StateContext<T,S,E,C> stateContext)
Enters this state is deep mode: mode if there is one.

Parameters:
stateContext - the event context.
Returns:
the active state.

enterShallow

ImmutableState<T,S,E,C> enterShallow(StateContext<T,S,E,C> stateContext)
Enters this state is shallow mode: The entry action is executed and the initial state is entered in shallow mode if there is one.

Parameters:
stateContext -
Returns:
child state entered by shadow

exit

void exit(StateContext<T,S,E,C> stateContext)
Exit state with state context

Parameters:
stateContext -

getParentState

ImmutableState<T,S,E,C> getParentState()
Returns:
parent state

getChildStates

List<ImmutableState<T,S,E,C>> getChildStates()
Returns:
child states

hasChildStates

boolean hasChildStates()
Returns:
whether state has child states

getInitialState

ImmutableState<T,S,E,C> getInitialState()
Returns:
initial child state

internalFire

void internalFire(StateContext<T,S,E,C> stateContext)
Notify transitions when receiving event.

Parameters:
stateContext -

isFinalState

boolean isFinalState()
Returns:
whether current state is final state

getLevel

int getLevel()
Returns:
hierarchy state level

getHistoryType

HistoryType getHistoryType()
Returns:
Historical type of state

getCompositeType

StateCompositeType getCompositeType()
Returns:
child states composite type

isParallelState

boolean isParallelState()
Returns:
whether child states composite type is parallel

isRegion

boolean isRegion()

verify

void verify()
Verify state correctness


getThis

ImmutableState<T,S,E,C> getThis()

getPath

String getPath()


Copyright © 2013-2014. All Rights Reserved.