com.koushikdutta.async.future
Class TransformFuture<T,F>

java.lang.Object
  extended by com.koushikdutta.async.future.SimpleCancellable
      extended by com.koushikdutta.async.future.SimpleFuture<T>
          extended by com.koushikdutta.async.future.TransformFuture<T,F>
All Implemented Interfaces:
Cancellable, DependentCancellable, DependentFuture<T>, FutureCallback<F>, java.util.concurrent.Future<T>

public abstract class TransformFuture<T,F>
extends SimpleFuture<T>
implements FutureCallback<F>


Field Summary
 
Fields inherited from class com.koushikdutta.async.future.SimpleCancellable
COMPLETED
 
Constructor Summary
TransformFuture()
           
 
Method Summary
protected  void error(java.lang.Exception e)
           
 TransformFuture<T,F> from(Future<F> future)
           
 void onCompleted(java.lang.Exception e, F result)
          onCompleted is called by the Future with the result or exception of the asynchronous operation.
protected abstract  void transform(F result)
           
 
Methods inherited from class com.koushikdutta.async.future.SimpleFuture
cancel, cancel, get, get, getCompletionCallback, setCallback, setComplete, setComplete, setComplete, setComplete, setParent
 
Methods inherited from class com.koushikdutta.async.future.SimpleCancellable
cancelCleanup, cleanup, completeCleanup, isCancelled, isDone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Future
isCancelled, isDone
 
Methods inherited from interface com.koushikdutta.async.future.Cancellable
isCancelled, isDone
 

Constructor Detail

TransformFuture

public TransformFuture()
Method Detail

onCompleted

public void onCompleted(java.lang.Exception e,
                        F result)
Description copied from interface: FutureCallback
onCompleted is called by the Future with the result or exception of the asynchronous operation.

Specified by:
onCompleted in interface FutureCallback<F>
Parameters:
e - Exception encountered by the operation
result - Result returned from the operation

from

public TransformFuture<T,F> from(Future<F> future)

error

protected void error(java.lang.Exception e)

transform

protected abstract void transform(F result)
                           throws java.lang.Exception
Throws:
java.lang.Exception