com.google.common.util.concurrent
Class ForwardingFuture<V>

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by com.google.common.util.concurrent.ForwardingFuture<V>
All Implemented Interfaces:
Future<V>

public abstract class ForwardingFuture<V>
extends com.google.common.collect.ForwardingObject
implements Future<V>

A Future which forwards all its method calls to another future. Subclasses should override one or more methods to modify the behavior of the backing collection as desired per the decorator pattern.

Since:
9.09.15 tentative
Author:
Sven Mawson
See Also:
ForwardingObject

Constructor Summary
ForwardingFuture()
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
protected abstract  Future<V> delegate()
           
 V get()
           
 V get(long timeout, TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 
Methods inherited from class com.google.common.collect.ForwardingObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForwardingFuture

public ForwardingFuture()
Method Detail

delegate

protected abstract Future<V> delegate()
Specified by:
delegate in class com.google.common.collect.ForwardingObject

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<V>

get

public V get()
      throws InterruptedException,
             ExecutionException
Specified by:
get in interface Future<V>
Throws:
InterruptedException
ExecutionException

get

public V get(long timeout,
             TimeUnit unit)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Specified by:
get in interface Future<V>
Throws:
InterruptedException
ExecutionException
TimeoutException