public class AsyncFutureImpl<V> extends java.lang.Object implements Future<V>
Future
implementation whose computation is carried out elsewhere.
Call the set(Object)
method or set(Throwable)
method to set the value to the future.Constructor and Description |
---|
AsyncFutureImpl() |
AsyncFutureImpl(java.lang.Throwable value) |
AsyncFutureImpl(V value) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
set(java.lang.Throwable problem) |
void |
set(V value) |
void |
setAsCancelled()
Marks this task as cancelled.
|
public AsyncFutureImpl()
public AsyncFutureImpl(V value)
public AsyncFutureImpl(java.lang.Throwable value)
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<V>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<V>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<V>
public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<V>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public V 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<V>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void set(V value)
public void set(java.lang.Throwable problem)
public void setAsCancelled()
Copyright © 2013. All Rights Reserved.