public class AsyncFutureImpl<V> extends 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(Throwable value) |
AsyncFutureImpl(V value) |
public AsyncFutureImpl()
public AsyncFutureImpl(V value)
public AsyncFutureImpl(Throwable value)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public void set(V value)
public void set(Throwable problem)
public void setAsCancelled()
Copyright © 2013. All rights reserved.