- java.lang.Object
-
- io.github.interacto.fsm.Transition<E>
-
- io.github.interacto.fsm.TimeoutTransition<E>
-
public class TimeoutTransition<E> extends Transition<E>
-
-
Field Summary
Fields Modifier and Type Field Description static StringTIMEOUT_THREAD_NAME_BASEThe base name (starts with) of the threads created for the timeout.-
Fields inherited from class io.github.interacto.fsm.Transition
src, tgt
-
-
Constructor Summary
Constructors Constructor Description TimeoutTransition(OutputState<E> srcState, InputState<E> tgtState, LongSupplier timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(E event)Optional<InputState<E>>execute(E event)Set<Object>getAcceptedEvents()protected booleanisGuardOK(E event)voidstartTimeout()Launches the timer.voidstopTimeout()Stops the timer.-
Methods inherited from class io.github.interacto.fsm.Transition
action, uninstall
-
-
-
-
Field Detail
-
TIMEOUT_THREAD_NAME_BASE
public static final String TIMEOUT_THREAD_NAME_BASE
The base name (starts with) of the threads created for the timeout.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeoutTransition
public TimeoutTransition(OutputState<E> srcState, InputState<E> tgtState, LongSupplier timeout)
-
-
Method Detail
-
startTimeout
public void startTimeout()
Launches the timer.
-
stopTimeout
public void stopTimeout()
Stops the timer.
-
accept
protected boolean accept(E event)
- Specified by:
acceptin classTransition<E>
-
isGuardOK
protected boolean isGuardOK(E event)
- Specified by:
isGuardOKin classTransition<E>
-
execute
public Optional<InputState<E>> execute(E event) throws CancelFSMException
- Overrides:
executein classTransition<E>- Throws:
CancelFSMException
-
getAcceptedEvents
public Set<Object> getAcceptedEvents()
- Specified by:
getAcceptedEventsin classTransition<E>
-
-