T
- the future result type of an asynchronous operation.@Contract(threading=IMMUTABLE) public class CompletedFuture<T> extends Object implements Future<T>, Cancellable
Constructor and Description |
---|
CompletedFuture(T result) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels the ongoing operation or process.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public CompletedFuture(T result)
public boolean isCancelled()
isCancelled
in interface Future<T>
public boolean cancel(boolean mayInterruptIfRunning)
public boolean cancel()
Cancellable
cancel
in interface Cancellable
true
if the operation or process has been cancelled as a result of
this method call or false
if it has already been cancelled or not started.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.