public abstract static class ShortAsyncBuilder.BaseShortTask extends java.lang.Object implements ShortTask
| Constructor and Description |
|---|
BaseShortTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitPausing()
Pauses the task, which lets the thread finish without completing the task.
|
boolean |
cancel(boolean cancelIfRunnning) |
short |
getShort()
A Type Specific get method that allows to reduce (un)boxing of primtives.
|
short |
getShort(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() |
public void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<java.lang.Short>public boolean cancel(boolean cancelIfRunnning)
cancel in interface java.util.concurrent.Future<java.lang.Short>public short getShort()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
ShortTaskpublic short getShort(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
ShortTaskgetShort in interface ShortTasktimeout - 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.Short>public boolean isDone()
isDone in interface java.util.concurrent.Future<java.lang.Short>public boolean isPaused()
ShortTaskpublic boolean isSuccessful()
ShortTaskisSuccessful in interface ShortTaskpublic void pause()
ShortTaskpublic void awaitPausing()
ShortTaskawaitPausing in interface ShortTask