V
- the type of result@Immutable public final class ImmediateFuture<V> extends Object implements Future<V>
Future
implementation that is immediately done.Constructor and Description |
---|
ImmediateFuture(V value)
Create a new
Future instance that is completed immediately and returns the supplied result. |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
static <T> ImmediateFuture<T> |
create(T value)
Factory method to more easily create an immediate future
|
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public static <T> ImmediateFuture<T> create(T value)
T
- the value typevalue
- the value that the future should returnpublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.