public abstract static class CharAsyncBuilder.BaseCharTask extends java.lang.Object implements CharTask
| Constructor and Description |
|---|
BaseCharTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitPausing()
Pauses the task, which lets the thread finish without completing the task.
|
boolean |
cancel(boolean cancelIfRunnning) |
char |
getChar()
A Type Specific get method that allows to reduce (un)boxing of primtives.
|
char |
getChar(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.Character>public boolean cancel(boolean cancelIfRunnning)
cancel in interface java.util.concurrent.Future<java.lang.Character>public char getChar()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
CharTaskpublic char getChar(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
CharTaskgetChar in interface CharTasktimeout - 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.Character>public boolean isDone()
isDone in interface java.util.concurrent.Future<java.lang.Character>public boolean isPaused()
CharTaskpublic boolean isSuccessful()
CharTaskisSuccessful in interface CharTaskpublic void pause()
CharTaskpublic void awaitPausing()
CharTaskawaitPausing in interface CharTask