public static class NonBlockingFiniteStateMachine.DelayedTransitionTo<S extends Enum<S>> extends Object implements Instruction, Event<S>
NonBlockingFiniteStateMachine.DelayedTransitionTo is a specialized Instruction for NonBlockingFiniteStateMachines that enables a StateEntryAction to request a delayed transition to another state, unlike a Instruction.TransitionTo Instruction which occurs immediately.Instruction.TransitionToInstruction.ProcessEvent<S extends Enum<S>>, Instruction.TransitionTo<S extends Enum<S>>NOTHING, STOP| Constructor and Description |
|---|
DelayedTransitionTo(S desiredState)
Constructs a
NonBlockingFiniteStateMachine.DelayedTransitionTo without a specified time (to be schedule as soon as possible). |
DelayedTransitionTo(S desiredState, long lDuration, TimeUnit timeUnit)
Constructs a
NonBlockingFiniteStateMachine.DelayedTransitionTo with the specified time. |
| Modifier and Type | Method and Description |
|---|---|
S |
getDesiredState(S currentState, ExecutionContext context)
Determines the desired state of the
FiniteStateMachine for the Event given the current state of the FiniteStateMachine. |
long |
getDuration()
Obtains the amount of time to wait before the transition to the desired state should occur
|
TimeUnit |
getTimeUnit()
Obtains the
TimeUnit for the getDuration() |
public DelayedTransitionTo(S desiredState)
NonBlockingFiniteStateMachine.DelayedTransitionTo without a specified time (to be schedule as soon as possible).desiredState - the desired state to which to transitionpublic DelayedTransitionTo(S desiredState, long lDuration, TimeUnit timeUnit)
NonBlockingFiniteStateMachine.DelayedTransitionTo with the specified time.desiredState - the desired state to which to transitionlDuration - the amount of time to wait before the desired transition should occurtimeUnit - the unit of time measurepublic S getDesiredState(S currentState, ExecutionContext context)
FiniteStateMachine for the Event given the current state of the FiniteStateMachine.getDesiredState in interface Event<S extends Enum<S>>currentState - the current state of the FiniteStateMachinecontext - the ExecutionContext for the EventFiniteStateMachine or null if no transition is requiredpublic long getDuration()
getTimeUnit()public TimeUnit getTimeUnit()
TimeUnit for the getDuration()TimeUnit