Class ConditionedFuture<R,S,T extends ConditionedTask<R,S> & ExecutableTask<R,S>>
java.lang.Object
de.linusdev.lutils.async.AbstractFuture<R,S,T>
de.linusdev.lutils.async.executable.ExecutableFuture<R,S,T>
de.linusdev.lutils.async.conditioned.ConditionedFuture<R,S,T>
- All Implemented Interfaces:
Future<R,,S> HasAsyncManager
public class ConditionedFuture<R,S,T extends ConditionedTask<R,S> & ExecutableTask<R,S>>
extends ExecutableFuture<R,S,T>
-
Field Summary
Fields inherited from class de.linusdev.lutils.async.AbstractFuture
asyncManager, before, canceled, done, lock, result, started, task, then -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ComputationResult<R,S> booleanChecks if thisFuturecan execute now.Methods inherited from class de.linusdev.lutils.async.AbstractFuture
beforeExecution, cancel, get, getAsyncManager, getTask, hasStarted, isCanceled, isDone, thenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.linusdev.lutils.async.manager.HasAsyncManager
getAsyncManager
-
Constructor Details
-
ConditionedFuture
-
-
Method Details
-
isExecutable
public boolean isExecutable()Description copied from class:ExecutableFutureChecks if thisFuturecan execute now.- Overrides:
isExecutablein classExecutableFuture<R,S, T extends ConditionedTask<R, S> & ExecutableTask<R, S>> - Returns:
trueif this future can be executed
-
executeHere
Executes theFutureif it has not beencanceledand is notdoneorAbstractFuture.started.
If theFutureis notexecutable, this function will wait until it is executable.- Overrides:
executeHerein classExecutableFuture<R,S, T extends ConditionedTask<R, S> & ExecutableTask<R, S>> - Returns:
resultornullif this future wascanceled.- Throws:
InterruptedException
-