T - the future result type of an asynchronous operation.public class BasicFuture<T> extends Object implements Future<T>, Cancellable
Future interface. BasicFuture
can be put into a completed state by invoking any of the following methods:
cancel(), failed(Throwable), or completed(Object).| 构造器和说明 |
|---|
BasicFuture() |
BasicFuture(FutureCallback<T> callback) |
BasicFuture(T value) |
public BasicFuture()
public BasicFuture(T value)
public BasicFuture(FutureCallback<T> callback)
public boolean isCancelled()
isCancelled 在接口中 Future<T>public T get() throws InterruptedException, ExecutionException
get 在接口中 Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get 在接口中 Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic boolean completed(T result)
public boolean failed(Throwable exception)
public boolean cancel()
Cancellablecancel 在接口中 CancellableCopyright © 2021–2022. All rights reserved.