T - the type of this FutureS - the type of the adaptee's Futurepublic abstract class FutureAdapter<T,S> extends Object implements Future<T>
Future parameterized over S into a Future
parameterized over T. All methods are delegated to the adaptee, where get()
and get(long, TimeUnit) call adapt(Object) on the adaptee's result.| 限定符 | 构造器和说明 |
|---|---|
protected |
FutureAdapter(Future<S> adaptee)
Constructs a new
FutureAdapter with the given adaptee. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract T |
adapt(S adapteeResult)
Adapts the given adaptee's result into T.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
protected Future<S> |
getAdaptee()
Returns the adaptee.
|
boolean |
isCancelled() |
boolean |
isDone() |
public boolean isCancelled()
isCancelled 在接口中 Future<T>@Nullable public T get() throws InterruptedException, ExecutionException
get 在接口中 Future<T>InterruptedExceptionExecutionException@Nullable public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get 在接口中 Future<T>InterruptedExceptionExecutionExceptionTimeoutException@Nullable protected abstract T adapt(S adapteeResult) throws ExecutionException
ExecutionException