public class NullFuture<T> extends java.lang.Object implements NotifyingFuture<T>
构造器和说明 |
---|
NullFuture(T retval) |
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 java.util.concurrent.Future<T>
public boolean isCancelled()
isCancelled
在接口中 java.util.concurrent.Future<T>
public boolean isDone()
isDone
在接口中 java.util.concurrent.Future<T>
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
在接口中 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
在接口中 java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public NotifyingFuture setListener(FutureListener<T> listener)
NotifyingFuture
setListener
在接口中 NotifyingFuture<T>
listener
- listener to attach