public abstract static class BooleanAsyncBuilder.BaseBooleanTask extends java.lang.Object implements BooleanTask
| Constructor and Description |
|---|
BaseBooleanTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitPausing()
Pauses the task, which lets the thread finish without completing the task.
|
boolean |
cancel(boolean cancelIfRunnning) |
boolean |
getBoolean()
A Type Specific get method that allows to reduce (un)boxing of primtives.
|
boolean |
getBoolean(long timeout,
java.util.concurrent.TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
|
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isPaused()
Helper function to detect if the task is currently paused.
|
boolean |
isSuccessful()
Quality of life function that allows to detect if no cancellation/exception was applied to this task and it completed on its own.
|
void |
pause()
Pauses the task, which lets the thread finish without completing the task.
|
void |
resume()
Continues the task if it wasn't already completed.
|
void |
run() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, getpublic void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<java.lang.Boolean>public boolean cancel(boolean cancelIfRunnning)
cancel in interface java.util.concurrent.Future<java.lang.Boolean>public boolean getBoolean()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
BooleanTaskgetBoolean in interface BooleanTaskjava.lang.InterruptedException - if the current thread was interrupted
while waitingjava.util.concurrent.ExecutionException - if the computation threw an exceptionpublic boolean getBoolean(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
BooleanTaskgetBoolean in interface BooleanTasktimeout - the maximum time to waitunit - the time unit of the timeout argumentjava.lang.InterruptedException - if the current thread was interrupted while waitingjava.util.concurrent.ExecutionException - if the computation threw an exceptionjava.util.concurrent.TimeoutException - if the wait timed outpublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<java.lang.Boolean>public boolean isDone()
isDone in interface java.util.concurrent.Future<java.lang.Boolean>public boolean isPaused()
BooleanTaskisPaused in interface BooleanTaskpublic boolean isSuccessful()
BooleanTaskisSuccessful in interface BooleanTaskpublic void pause()
BooleanTaskpause in interface BooleanTaskpublic void awaitPausing()
BooleanTaskawaitPausing in interface BooleanTaskpublic void resume()
BooleanTaskresume in interface BooleanTask