public class SettableFuture<V>
extends java.lang.Object
implements java.util.concurrent.RunnableFuture<V>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
done |
protected java.lang.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,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
void |
set(V value) |
void |
setException(java.lang.Throwable throwable) |
protected void |
waitForCompletion() |
protected void |
waitForCompletion(long timeout) |
protected V value
protected java.lang.Throwable throwable
protected volatile boolean done
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<V>public boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<V>public boolean isDone()
isDone in interface java.util.concurrent.Future<V>public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<V>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic V get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<V>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic void set(V value)
public void setException(java.lang.Throwable throwable)
protected void waitForCompletion()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected void waitForCompletion(long timeout)
throws java.lang.InterruptedException,
java.util.concurrent.TimeoutException
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutExceptionpublic void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<V>