public class NullFuture<T> extends java.lang.Object implements NotifyingFuture<T>
Constructor and Description |
---|
NullFuture(T retval) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
NotifyingFuture |
setListener(FutureListener<T> listener)
Attaches a listener and returns the same future instance, to allow for 'building' futures.
|
public NullFuture(T retval)
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<T>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<T>
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public T 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<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public NotifyingFuture setListener(FutureListener<T> listener)
NotifyingFuture
setListener
in interface NotifyingFuture<T>
listener
- listener to attachCopyright © 1998-2020 Red Hat. All Rights Reserved.