Module net.morimekta.terminal
Package net.morimekta.terminal.progress
Class ProgressManager.InternalTask<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- net.morimekta.terminal.progress.ProgressManager.InternalTask<T>
-
- Type Parameters:
T
- The return value for the progress task.
- All Implemented Interfaces:
Runnable
,CompletionStage<T>
,Flow.Subscriber<Progress>
,Future<T>
- Enclosing class:
- ProgressManager
public class ProgressManager.InternalTask<T> extends CompletableFuture<T> implements Flow.Subscriber<Progress>, Runnable
Internal task on the progress. Made visible for testing.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean interruptable)
boolean
complete(T t)
boolean
completeExceptionally(Throwable throwable)
void
onComplete()
void
onError(Throwable throwable)
void
onNext(Progress current)
Update the progress to reflect the current progress value.void
onSubscribe(Flow.Subscription subscription)
void
run()
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Method Detail
-
complete
public boolean complete(T t)
- Overrides:
complete
in classCompletableFuture<T>
-
completeExceptionally
public boolean completeExceptionally(Throwable throwable)
- Overrides:
completeExceptionally
in classCompletableFuture<T>
-
cancel
public boolean cancel(boolean interruptable)
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<T>
-
onNext
public void onNext(Progress current)
Update the progress to reflect the current progress value.- Specified by:
onNext
in interfaceFlow.Subscriber<T>
- Parameters:
current
- The new current progress value.
-
onError
public void onError(Throwable throwable)
- Specified by:
onError
in interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
-
-