public interface ShortTask
extends java.util.concurrent.RunnableFuture<java.lang.Short>
| Modifier and Type | Method and Description |
|---|---|
void |
awaitPausing()
Pauses the task, which lets the thread finish without completing the task.
|
default java.lang.Short |
get()
Deprecated.
|
default java.lang.Short |
get(long timeout,
java.util.concurrent.TimeUnit unit)
Deprecated.
|
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 |
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.
|
boolean isPaused()
void pause()
void awaitPausing()
void resume()
boolean isSuccessful()
short getShort()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
java.util.concurrent.CancellationException - if the computation was cancelledjava.util.concurrent.ExecutionException - if the computation threw an exceptionjava.lang.InterruptedException - if the current thread was interrupted
while waitingshort getShort(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
timeout - the maximum time to waitunit - the time unit of the timeout argumentjava.util.concurrent.CancellationException - if the computation was cancelledjava.util.concurrent.ExecutionException - if the computation threw an exceptionjava.lang.InterruptedException - if the current thread was interrupted while waitingjava.util.concurrent.TimeoutException - if the wait timed out@Deprecated
default java.lang.Short get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<java.lang.Short>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException@Deprecated
default java.lang.Short 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<java.lang.Short>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException