public final class KnownFuture<T> extends Object implements Future<T>
Copyright © Enremmeta LLC 2015. All Rights Reserved.
Modifier and Type | Field and Description |
---|---|
static KnownFuture |
KNOWN_NULL_FUTURE |
static KnownFuture |
KNOWN_STALE_FUTURE |
private String |
note |
private T |
obj |
Constructor and Description |
---|
KnownFuture(T obj) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
private KnownFuture<T> |
setNote(String note) |
String |
toString() |
public static final KnownFuture KNOWN_NULL_FUTURE
public static final KnownFuture KNOWN_STALE_FUTURE
private final T obj
private String note
public KnownFuture(T obj)
public final boolean cancel(boolean mayInterruptIfRunning)
public final boolean isCancelled()
isCancelled
in interface Future<T>
public final T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public final T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
private KnownFuture<T> setNote(String note)