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.3 by dl, Tue Jun 3 16:44:36 2003 UTC vs.
Revision 1.4 by dl, Tue Jun 24 14:34:48 2003 UTC

# Line 9 | Line 9 | package java.util.concurrent;
9   /**
10   * A cancellable asynchronous computation.
11   *
12 < * <p>Provides methods to start and cancel the computation, query to see if
13 < * the computation is complete, and retrieve the result of the computation.
14 < * The result can only be retrieved when the computation has completed;
15 < * the <tt>get</tt> method will block if the computation has not yet completed.
16 < * Once the computation is completed, the result cannot be changed, nor can the
17 < * computation be restarted or cancelled.
12 > * <p><tt>FutureTask</tt> provides methods to start and cancel the
13 > * computation, query to see if the computation is complete, and
14 > * retrieve the result of the computation.  The result can only be
15 > * retrieved when the computation has completed; the <tt>get</tt>
16 > * method will block if the computation has not yet completed.  Once
17 > * the computation is completed, the result cannot be changed, nor can
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
# Line 34 | Line 35 | package java.util.concurrent;
35   * @spec JSR-166
36   * @revised $Date$
37   * @editor $Author$
38 + * @author Doug Lea
39   */
40   public class FutureTask<V> extends CancellableTask implements Cancellable, Future<V>, Runnable {
41  
# Line 77 | Line 79 | public class FutureTask<V> extends Cance
79       * @return the computed result
80       * @throws CancellationException if task producing this value was
81       * cancelled before completion
82 <     * @throws ExecutionException if the underlying computation threw an exception
83 <     * @throws InterruptedException if current thread was interrupted while waiting
82 >     * @throws ExecutionException if the underlying computation threw
83 >     * an exception
84 >     * @throws InterruptedException if current thread was interrupted
85 >     * while waiting
86       */
87      public V get() throws InterruptedException, ExecutionException {
88          return ((InnerCancellableFuture<V>)getRunnable()).get();
# Line 91 | 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 cancelled before completion
99 <     * @throws ExecutionException if the underlying computation
100 <     * threw an exception.
101 <     * @throws InterruptedException if current thread was interrupted while waiting
98 >     * @throws CancellationException if task producing this value was
99 >     * cancelled before completion
100 >     * @throws ExecutionException if the underlying computation threw
101 >     * an exception.
102 >     * @throws InterruptedException if current thread was interrupted
103 >     * while waiting
104       * @throws TimeoutException if the wait timed out
105       */
106      public V get(long timeout, TimeUnit unit)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines