Class ForwardingFuture<V>
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.util.concurrent.ForwardingFuture<V>
-
- All Implemented Interfaces:
Future<V>
- Direct Known Subclasses:
ForwardingFuture.SimpleForwardingFuture,ForwardingListenableFuture
public abstract class ForwardingFuture<V> extends ForwardingObject implements Future<V>
AFuturewhich forwards all its method calls to another future. Subclasses should override one or more methods to modify the behavior of the backing future as desired per the decorator pattern.Most subclasses can just use
ForwardingFuture.SimpleForwardingFuture.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classForwardingFuture.SimpleForwardingFuture<V>A simplified version ofForwardingFuturewhere subclasses can pass in an already constructedFutureas the delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Vget()Vget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()-
Methods inherited from class com.google.common.collect.ForwardingObject
toString
-
-
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-