@FunctionalInterface public interface RunnableFactory
Runnable that can be stopped by complying with a
RunningCondition that is passed to the factory method upon construction of
the runnable.| Modifier and Type | Interface and Description |
|---|---|
static interface |
RunnableFactory.RunningCondition
Condition for a runnable created by
create(RunningCondition) telling the runnable when
to stop. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Runnable |
create(RunnableFactory.RunningCondition runningCondition)
Creates a runnable that stops when the supplied
runningCondition returns false. |
java.lang.Runnable create(RunnableFactory.RunningCondition runningCondition)
runningCondition returns false. THe runnable is expected
to perform some iterative function and it is obliged to check the running condition regularly and return from the
run() method when the running condition returns false.runningCondition - the condition to be checked regularly by the returned runnable telling it either to
continue or to abort