ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/FutureTask.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/FutureTask.java (file contents):
Revision 1.5 by jozart, Wed Jun 25 08:45:43 2003 UTC vs.
Revision 1.6 by tim, Thu Jul 31 19:49:42 2003 UTC

# Line 18 | Line 18 | package java.util.concurrent;
18   * the computation be restarted or cancelled.
19   *
20   * <p>Because <tt>FutureTask</tt> implements <tt>Runnable</tt>, a
21 < * <tt>FutureTask</tt> can be submitted to an {@link Executor} for
21 > * <tt>FutureTask</tt> can be submitted to an {@link Executor} for
22   * current or deferred execution.
23   *
24 < * <p>A <tt>FutureTask</tt> can be used to wrap a <tt>Callable</tt> or
25 < * <tt>Runnable</tt> object so that it can be scheduled for execution in a
24 > * <p>A <tt>FutureTask</tt> can be used to wrap a <tt>Callable</tt> or
25 > * <tt>Runnable</tt> object so that it can be scheduled for execution in a
26   * thread or an <tt>Executor</tt>, cancel
27   * computation before the computation completes, and wait for or
28   * retrieve the results.  If the computation threw an exception, the
# Line 48 | Line 48 | public class FutureTask<V> extends Cance
48      public FutureTask(Callable<V> callable) {
49          // must set after super ctor call to use inner class
50          super();
51 <        setRunnable(new InnerCancellableFuture(callable));
51 >        setRunnable(new InnerCancellableFuture<V>(callable));
52      }
53  
54      /**
# Line 63 | Line 63 | public class FutureTask<V> extends Cance
63       */
64      public FutureTask(final Runnable runnable, final V result) {
65          super();
66 <        setRunnable(new InnerCancellableFuture
66 >        setRunnable(new InnerCancellableFuture<V>
67                      (new Callable<V>() {
68                          public V call() {
69                              runnable.run();
# Line 95 | Line 95 | public class FutureTask<V> extends Cance
95       * @param timeout the maximum time to wait
96       * @param unit the time unit of the timeout argument
97       * @return value of this task
98 <     * @throws CancellationException if task producing this value was
98 >     * @throws CancellationException if task producing this value was
99       * cancelled before completion
100       * @throws ExecutionException if the underlying computation threw
101       * an exception.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines