public class SettableFuture<V> extends Object implements RunnableFuture<V>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
done |
protected Throwable |
throwable |
protected V |
value |
| Constructor and Description |
|---|
SettableFuture() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
void |
set(V value) |
void |
setException(Throwable throwable) |
protected void |
waitForCompletion() |
protected void |
waitForCompletion(long timeout) |
protected V value
protected Throwable throwable
protected volatile boolean done
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<V>public V get() throws InterruptedException, ExecutionException
get in interface Future<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void set(V value)
public void setException(Throwable throwable)
protected void waitForCompletion()
throws InterruptedException
InterruptedExceptionprotected void waitForCompletion(long timeout)
throws InterruptedException,
TimeoutException
InterruptedExceptionTimeoutExceptionpublic void run()
run in interface Runnablerun in interface RunnableFuture<V>Copyright © 2019. All rights reserved.