|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.util.concurrent.AbstractFuture<V> com.google.common.util.concurrent.AbstractListenableFuture<V> com.google.common.util.concurrent.ValueFuture<V>
public class ValueFuture<V>
A simple ListenableFuture that holds a value or an exception.
Method Summary | ||
---|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
|
static
|
create()
Creates a new ValueFuture in the default state. |
|
boolean |
set(V newValue)
Sets the value of this future. |
|
boolean |
setException(Throwable t)
Sets the future to having failed with the given exception. |
Methods inherited from class com.google.common.util.concurrent.AbstractListenableFuture |
---|
addListener, done |
Methods inherited from class com.google.common.util.concurrent.AbstractFuture |
---|
cancel, get, get, isCancelled, isDone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.concurrent.Future |
---|
get, get, isCancelled, isDone |
Method Detail |
---|
public static <T> ValueFuture<T> create()
ValueFuture
in the default state.
public boolean set(V newValue)
true
if
the value was successfully set, or false
if the future has already
been set or cancelled.
set
in class AbstractFuture<V>
newValue
- the value the future should hold.
public boolean setException(Throwable t)
true
if the exception was successfully set,
or false
if the future has already been set or cancelled.
setException
in class AbstractFuture<V>
t
- the exception the future should hold.
public boolean cancel(boolean mayInterruptIfRunning)
A ValueFuture is never considered in the running state, so the
mayInterruptIfRunning
argument is ignored.
cancel
in interface Future<V>
cancel
in class AbstractFuture<V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |