Modul speiger.src.collections
Schnittstelle DoubleTask
- Alle Superschnittstellen:
Future<Double>,Runnable,RunnableFuture<Double>
- Alle bekannten Implementierungsklassen:
DoubleAsyncBuilder.BaseDoubleTask
A Type Specific Task interface that allows you to keep track of the task that is currently running.
It extends Runnable future and supports said functions but also provides quality of life functions like:
- isSuccesfull: which allows to detect if the task was completed properly and not interrupted or crashed. - pause/resume: which allows to pause/resume the task at any moment, making it easier to create thread-safe actions.
It extends Runnable future and supports said functions but also provides quality of life functions like:
- isSuccesfull: which allows to detect if the task was completed properly and not interrupted or crashed. - pause/resume: which allows to pause/resume the task at any moment, making it easier to create thread-safe actions.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen java.util.concurrent.Future
Future.State -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidPauses the task, which lets the thread finish without completing the task.default Doubleget()Veraltet.default DoubleVeraltet.doubleA Type Specific get method that allows to reduce (un)boxing of primtives.doubleWaits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.booleanisPaused()Helper function to detect if the task is currently paused.booleanQuality of life function that allows to detect if no cancellation/exception was applied to this task and it completed on its own.voidpause()Pauses the task, which lets the thread finish without completing the task.voidresume()Continues the task if it wasn't already completed.Von Schnittstelle geerbte Methoden java.util.concurrent.Future
cancel, exceptionNow, isCancelled, isDone, resultNow, stateVon Schnittstelle geerbte Methoden java.util.concurrent.RunnableFuture
run
-
Methodendetails
-
isPaused
boolean isPaused()Helper function to detect if the task is currently paused.- Gibt zurück:
- true if paused
-
pause
void pause()Pauses the task, which lets the thread finish without completing the task. Tasks are written in the way where they can pause without any issues. This won't be instant, as this function is applied asynchronous and doesn't check if the thread paused. So make sure it had the time to pause. -
awaitPausing
void awaitPausing()Pauses the task, which lets the thread finish without completing the task. Tasks are written in the way where they can pause without any issues. This won't be instant, as this function is applied asynchronous. It will await the pausing of the task. -
resume
void resume()Continues the task if it wasn't already completed. This is done by resubmitting the task to the executor provided. -
isSuccessful
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.- Gibt zurück:
- true if it was properly completed
-
getDouble
A Type Specific get method that allows to reduce (un)boxing of primtives. Waits if necessary for the computation to complete, and then retrieves its result.- Gibt zurück:
- the computed result as primitive
- Löst aus:
CancellationException- if the computation was cancelledExecutionException- if the computation threw an exceptionInterruptedException- if the current thread was interrupted while waiting
-
getDouble
double getDouble(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.- Parameter:
timeout- the maximum time to waitunit- the time unit of the timeout argument- Gibt zurück:
- the computed result as primitive
- Löst aus:
CancellationException- if the computation was cancelledExecutionException- if the computation threw an exceptionInterruptedException- if the current thread was interrupted while waitingTimeoutException- if the wait timed out
-
get
Veraltet.- Angegeben von:
getin SchnittstelleFuture<Double>- Löst aus:
InterruptedExceptionExecutionException
-
get
@Deprecated default Double get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Veraltet.- Angegeben von:
getin SchnittstelleFuture<Double>- Löst aus:
InterruptedExceptionExecutionExceptionTimeoutException
-