API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. FutureTask View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      FutureTask
Implements
 RunnableFuture
Subclasses
Description
public class FutureTask
  A cancellable asynchronous computation.
See also:   
Constructors
public FutureTask (Callable< V> callable)
  Creates a FutureTask that will upon running, execute the given Callable.
public FutureTask (Runnable runnable, V result)
  Creates a FutureTask that will upon running, execute the given Runnable, and arrange that get will return the given result on successful completion.
Methods
Hide/Show inherited methods
public boolean cancel (boolean mayInterruptIfRunning)
protected void done ()
  Protected method invoked when this task transitions to state isDone (whether normally or via cancellation).
public V get () throws InterruptedException ExecutionException
 
public V get (long timeout, TimeUnit unit) throws InterruptedException ExecutionException TimeoutException
 
public boolean isCancelled ()
public boolean isDone ()
public void run () [Specified in RunnableFuture]
Sets this Future to the result of its computation unless it has been cancelled.
protected boolean runAndReset ()
  Executes the computation without setting its result, and then resets this Future to initial state, failing to do so if the computation encounters an exception or is cancelled.
protected void set ( V v)
  Sets the result of this Future to the given value unless this future has already been set or has been cancelled.
protected void setException (Throwable t)
  Causes this future to report an ExecutionException with the given throwable as its cause, unless this Future has already been set or has been cancelled.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar