| Modifier and Type | Class and Description |
|---|---|
| public static class | Operations.CompletedFuture<
operation result representation. T>This class represents a |
| Modifier and Type | Field and Description |
|---|---|
| private static final Cancellable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Cancellable | Returns: the cancellable operation handle.the result future future)Creates a |
| public static Cancellable | Returns: the no-op cancellable operation handle.Creates a |
| NOOP_CANCELLABLE | back to summary |
|---|---|
| private static final Cancellable NOOP_CANCELLABLE | |
| Operations | back to summary |
|---|---|
| public Operations() | |
| cancellable | back to summary |
|---|---|
| public static Cancellable cancellable(final Future<?> future) Creates a
| |
| nonCancellable | back to summary |
|---|---|
| public static Cancellable nonCancellable() Creates a
| |
Future in the completed state with a fixed result.
The outcome of the future cannot be altered and it cannot be cancelled.
| Modifier and Type | Field and Description |
|---|---|
| private final T |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | cancel(final 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. |
| public T | get()
Implements java. |
| public T | get(final long
the maximum time to wait timeout, final TimeUnit the time unit of the timeout argument unit)Implements java. |
| public boolean | isCancelled()
Implements java. true if this task was cancelled before it completed
normally.
|
| public boolean |
| result | back to summary |
|---|---|
| private final T result | |
| CompletedFuture | back to summary |
|---|---|
| public CompletedFuture(final T result) | |
| cancel | back to summary |
|---|---|
| public boolean cancel(final 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(final long timeout, final 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.
| |
| 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
| |