Future
Future
Deprecated
since 6.0.
as of 6.0, with no concrete replacement
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.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final Future | |
| private final Object | |
| private Object | |
| private FutureAdapter. |
| Access | Constructor and Description |
|---|---|
| protected | FutureAdapter(Future<S>
the future to delegate to adaptee)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract T | |
| pack-priv final T | |
| public boolean | cancel(boolean
true if the thread
executing this task should be interrupted (if the thread is
known to the implementation); otherwise, in-progress tasks are
allowed to completeImplements java. Attempts to cancel execution of this task. |
| public T | get()
Implements java. Waits if necessary for the computation to complete, and then retrieves its result. |
| public T | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
| protected Future | |
| public boolean | isCancelled()
Implements java. Returns |
| public boolean |
| adaptee | back to summary |
|---|---|
| private final Future<S> adaptee | |
| mutex | back to summary |
|---|---|
| private final Object mutex | |
| result | back to summary |
|---|---|
| private Object result
| |
| state | back to summary |
|---|---|
| private FutureAdapter. | |
| FutureAdapter | back to summary |
|---|---|
| protected FutureAdapter(Future<S> adaptee) Constructs a new
| |
| adapt | back to summary |
|---|---|
| protected abstract T adapt(S adapteeResult) throws ExecutionException Adapts the given adaptee's result into T.
| |
| adaptInternal | back to summary |
|---|---|
pack-priv final T adaptInternal(S adapteeResult) throws ExecutionException
| |
| cancel | back to summary |
|---|---|
| public boolean cancel(boolean mayInterruptIfRunning) Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use
| |
| get | back to summary |
|---|---|
| public T get() throws InterruptedException, ExecutionException Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Implements java. Doc from java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
| |
| getAdaptee | back to summary |
|---|---|
| protected Future Returns the adaptee. | |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Implements java. Doc from java. Returns
| |
| isDone | back to summary |
|---|---|
| public boolean isDone() Implements java. Doc from java. Returns
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final FutureAdapter. | |
| public static final FutureAdapter. | |
| public static final FutureAdapter. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static FutureAdapter. | |
| public static FutureAdapter. |
| FAILURE | back to summary |
|---|---|
| public static final FutureAdapter. | |
| NEW | back to summary |
|---|---|
| public static final FutureAdapter. | |
| SUCCESS | back to summary |
|---|---|
| public static final FutureAdapter. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static FutureAdapter. | |
| values | back to summary |
|---|---|
| public static FutureAdapter. | |