public class AsyncFutureImpl<V> extends Object implements Future<V>
Future
implementation whose computation is carried out elsewhere.
Call the set(Object)
method or set(Throwable)
method to set the value to the future.Constructor and Description |
---|
AsyncFutureImpl() |
AsyncFutureImpl(Throwable value) |
AsyncFutureImpl(V value) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
set(Throwable problem) |
void |
set(V value) |
void |
setAsCancelled()
Marks this task as cancelled.
|
public AsyncFutureImpl()
public AsyncFutureImpl(V value)
public AsyncFutureImpl(Throwable value)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
@CheckForNull public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public void set(V value)
public void set(Throwable problem)
public void setAsCancelled()
Copyright © 2004–2022. All rights reserved.