|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.squirrelframework.foundation.fsm.impl.StateMachineBuilderImpl<T,S,E,C>
public class StateMachineBuilderImpl<T extends StateMachine<T,S,E,C>,S,E,C>
| Field Summary | |
|---|---|
protected Converter<E> |
eventConverter
|
protected Converter<S> |
stateConverter
|
| Method Summary | |
|---|---|
MutableState<T,S,E,C> |
defineFinalState(S stateId)
Define a final state in state machine model |
void |
defineFinishEvent(E finishEvent)
Define event for parallel transition finished |
MutableState<T,S,E,C> |
defineLinkedState(S stateId,
StateMachineBuilder<? extends StateMachine<?,S,E,C>,S,E,C> linkedStateMachineBuilder,
S initialLinkedState,
Object... extraParams)
Define a linked state |
void |
defineParallelStatesOn(S parentStateId,
S... childStateIds)
Define sequential child states on parent state. |
void |
defineSequentialStatesOn(S parentStateId,
HistoryType historyType,
S... childStateIds)
Define sequential child states on parent state |
void |
defineSequentialStatesOn(S parentStateId,
S... childStateIds)
Define sequential child states whose hierarchy type is default set to NONE on parent state |
void |
defineStartEvent(E startEvent)
Define event for state machine started |
MutableState<T,S,E,C> |
defineState(S stateId)
Define a new state in state machine model |
void |
defineTerminateEvent(E terminateEvent)
Define event for state machine terminated |
MutableState<T,S,E,C> |
defineTimedState(S stateId,
long initialDelay,
long timeInterval,
E autoEvent,
C autoContext)
Define a timed state |
ExternalTransitionBuilder<T,S,E,C> |
externalTransition()
Start to build external transition |
ExternalTransitionBuilder<T,S,E,C> |
externalTransition(int priority)
|
InternalTransitionBuilder<T,S,E,C> |
internalTransition()
Start to build internal transition |
InternalTransitionBuilder<T,S,E,C> |
internalTransition(int priority)
|
LocalTransitionBuilder<T,S,E,C> |
localTransition()
Start to build local transition |
LocalTransitionBuilder<T,S,E,C> |
localTransition(int priority)
|
T |
newStateMachine(S initialStateId)
Create a new state machine instance |
T |
newStateMachine(S initialStateId,
Object... extraParams)
Create new state machine instance according to state machine definition |
T |
newStateMachine(S initialStateId,
StateMachineConfiguration configuration,
Object... extraParams)
Create new state machine instance according to state machine definition |
EntryExitActionBuilder<T,S,E,C> |
onEntry(S stateId)
Define on entry actions for state |
EntryExitActionBuilder<T,S,E,C> |
onExit(S stateId)
Define on exit actions for state |
void |
setStateMachineConfiguration(StateMachineConfiguration configure)
Set default state machine configuration for state machine instance created by this builder |
DeferBoundActionBuilder<T,S,E,C> |
transit()
|
ExternalTransitionBuilder<T,S,E,C> |
transition()
Start to build external transition, same as externalTransition |
ExternalTransitionBuilder<T,S,E,C> |
transition(int priority)
Same as externalTransition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Converter<S> stateConverter
protected final Converter<E> eventConverter
| Method Detail |
|---|
public ExternalTransitionBuilder<T,S,E,C> externalTransition()
StateMachineBuilder
externalTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public ExternalTransitionBuilder<T,S,E,C> transition()
StateMachineBuilder
transition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public DeferBoundActionBuilder<T,S,E,C> transit()
transit in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public LocalTransitionBuilder<T,S,E,C> localTransition()
StateMachineBuilder
localTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public InternalTransitionBuilder<T,S,E,C> internalTransition()
StateMachineBuilder
internalTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public ExternalTransitionBuilder<T,S,E,C> externalTransition(int priority)
externalTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public ExternalTransitionBuilder<T,S,E,C> transition(int priority)
StateMachineBuilder
transition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>priority - transition priority
public LocalTransitionBuilder<T,S,E,C> localTransition(int priority)
localTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public InternalTransitionBuilder<T,S,E,C> internalTransition(int priority)
internalTransition in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public T newStateMachine(S initialStateId)
StateMachineBuilder
newStateMachine in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>initialStateId - initial state id
public T newStateMachine(S initialStateId,
Object... extraParams)
StateMachineBuilder
newStateMachine in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>initialStateId - the id of state machine initial stateextraParams - other parameters for instantiate state machine
public T newStateMachine(S initialStateId,
StateMachineConfiguration configuration,
Object... extraParams)
StateMachineBuilder
newStateMachine in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>initialStateId - the id of state machine initial stateconfiguration - configuration for state machineextraParams - other parameters for instantiate state machine
public MutableState<T,S,E,C> defineState(S stateId)
StateMachineBuilder
defineState in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - id of new state
public MutableState<T,S,E,C> defineFinalState(S stateId)
StateMachineBuilder
defineFinalState in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - id of final state
public MutableState<T,S,E,C> defineLinkedState(S stateId,
StateMachineBuilder<? extends StateMachine<?,S,E,C>,S,E,C> linkedStateMachineBuilder,
S initialLinkedState,
Object... extraParams)
StateMachineBuilder
defineLinkedState in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - id of linked statelinkedStateMachineBuilder - linked state machine builderinitialLinkedState - initial linked stateextraParams - additional parameters used to create linked state machine
public MutableState<T,S,E,C> defineTimedState(S stateId,
long initialDelay,
long timeInterval,
E autoEvent,
C autoContext)
StateMachineBuilder
defineTimedState in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - state idinitialDelay - initial delay mstimeInterval - time period if null not repeat
public void defineSequentialStatesOn(S parentStateId,
S... childStateIds)
StateMachineBuilder
defineSequentialStatesOn in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>parentStateId - id of parent statechildStateIds - child states id of parent state. The first child state will be used as initial child state of parent state.
public void defineSequentialStatesOn(S parentStateId,
HistoryType historyType,
S... childStateIds)
StateMachineBuilder
defineSequentialStatesOn in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>parentStateId - id of parent statehistoryType - history type of parent statechildStateIds - child states id of parent state. The first child state will be used as initial child state of parent state.
public void defineParallelStatesOn(S parentStateId,
S... childStateIds)
StateMachineBuilder
defineParallelStatesOn in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>parentStateId - id of parent statechildStateIds - child states id of parent state. The first child state will be used as initial child state of parent state.public EntryExitActionBuilder<T,S,E,C> onEntry(S stateId)
StateMachineBuilder
onEntry in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - the id of state
public EntryExitActionBuilder<T,S,E,C> onExit(S stateId)
StateMachineBuilder
onExit in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>stateId - the id of state
public void defineFinishEvent(E finishEvent)
StateMachineBuilder
defineFinishEvent in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public void defineStartEvent(E startEvent)
StateMachineBuilder
defineStartEvent in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public void defineTerminateEvent(E terminateEvent)
StateMachineBuilder
defineTerminateEvent in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>public void setStateMachineConfiguration(StateMachineConfiguration configure)
StateMachineBuilder
setStateMachineConfiguration in interface StateMachineBuilder<T extends StateMachine<T,S,E,C>,S,E,C>configure - state machine default configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||