T - the type of elements maintained by this Collectionpublic abstract static class ObjectAsyncBuilder.BaseObjectTask<T> extends java.lang.Object implements ObjectTask<T>
| Constructor and Description |
|---|
BaseObjectTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitPausing()
Pauses the task, which lets the thread finish without completing the task.
|
boolean |
cancel(boolean cancelIfRunnning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
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() |
public void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<T>public boolean cancel(boolean cancelIfRunnning)
cancel in interface java.util.concurrent.Future<T>public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<T>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<T>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<T>public boolean isDone()
isDone in interface java.util.concurrent.Future<T>public boolean isPaused()
ObjectTaskisPaused in interface ObjectTask<T>public boolean isSuccessful()
ObjectTaskisSuccessful in interface ObjectTask<T>public void pause()
ObjectTaskpause in interface ObjectTask<T>public void awaitPausing()
ObjectTaskawaitPausing in interface ObjectTask<T>public void resume()
ObjectTaskresume in interface ObjectTask<T>