com.googlecode.android_scripting.future
Class FutureResult<T>

java.lang.Object
  extended by com.googlecode.android_scripting.future.FutureResult<T>
All Implemented Interfaces:
java.util.concurrent.Future<T>

public class FutureResult<T>
extends java.lang.Object
implements java.util.concurrent.Future<T>

FutureResult represents an eventual execution result for asynchronous operations.

Author:
Damon Kohler (damonkohler@gmail.com)

Constructor Summary
FutureResult()
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 T get()
           
 T get(long timeout, java.util.concurrent.TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 void set(T result)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureResult

public FutureResult()
Method Detail

set

public void set(T result)

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface java.util.concurrent.Future<T>

get

public T get()
      throws java.lang.InterruptedException
Specified by:
get in interface java.util.concurrent.Future<T>
Throws:
java.lang.InterruptedException

get

public T get(long timeout,
             java.util.concurrent.TimeUnit unit)
      throws java.lang.InterruptedException
Specified by:
get in interface java.util.concurrent.Future<T>
Throws:
java.lang.InterruptedException

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface java.util.concurrent.Future<T>

isDone

public boolean isDone()
Specified by:
isDone in interface java.util.concurrent.Future<T>