Futures#immediateFuture.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final LazyLogger | |
| pack-priv static final ListenableFuture | |
| private final V |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListener(Runnable
the listener to run when the computation is complete listener, Executor the executor to run the listener in executor)Implements com. |
| 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. |
| public V | get()
Implements java. |
| public V | get(long
the maximum time to wait timeout, 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 | |
| public String |
| log | back to summary |
|---|---|
| private static final LazyLogger log | |
| NULL | back to summary |
|---|---|
| pack-priv static final ListenableFuture<?> NULL | |
| value | back to summary |
|---|---|
| private final V value
| |
| ImmediateFuture | back to summary |
|---|---|
| pack-priv ImmediateFuture(V value) | |
| addListener | back to summary |
|---|---|
| public void addListener(Runnable listener, Executor executor) Implements com. Doc from com. Registers a listener to be run on the given executor.
The listener will run when the There is no guaranteed ordering of execution of listeners, but any listener added through this method is guaranteed to be called once the computation is complete. Exceptions thrown by a listener will be propagated up to the executor. Any exception thrown
during Note If your listener is lightweight -- and will not cause stack overflow by completing
more futures or adding more This is the most general listener interface. For common operations performed using
listeners, see Memory consistency effects: Actions in a thread prior to adding a listener happen-before its execution begins, perhaps in another thread. Guava implementations of
| |
| 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 V get() Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public V get(long timeout, TimeUnit unit) throws ExecutionException 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
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ImmediateFuture. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final ImmediateFuture. | |
| ImmediateCancelledFuture | back to summary |
|---|---|
| pack-priv ImmediateCancelledFuture() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| ImmediateFailedFuture | back to summary |
|---|---|
| pack-priv ImmediateFailedFuture(Throwable thrown) | |