1 |
|
/* |
2 |
< |
* @(#)Future.java |
2 |
> |
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
> |
* Expert Group and released to the public domain. Use, modify, and |
4 |
> |
* redistribute this code in any way without acknowledgement. |
5 |
|
*/ |
6 |
|
|
7 |
|
package java.util.concurrent; |
8 |
|
|
9 |
|
/** |
10 |
< |
* A <tt>Future</tt> represents the result of an asynchronous computation. |
11 |
< |
* Methods are provided to check if the computation is complete, |
12 |
< |
* to wait for its completion, and to retrieve the result of the |
13 |
< |
* computation. The result can only be retrieved when the computation |
14 |
< |
* has completed. The <tt>get</tt> method will block until the computation |
15 |
< |
* has completed. Once the computation has completed, the result cannot |
16 |
< |
* be changed, nor can the computation be restarted or cancelled. |
10 |
> |
* A <tt>Future</tt> represents the result of an asynchronous |
11 |
> |
* computation. Methods are provided to check if the computation is |
12 |
> |
* complete, to wait for its completion, and to retrieve the result of |
13 |
> |
* the computation. The result can only be retrieved using method |
14 |
> |
* <tt>get</tt> when the computation has completed, blocking if |
15 |
> |
* necessary until it is ready. Once the computation has completed, |
16 |
> |
* the computation cannot be restarted or cancelled. |
17 |
|
* |
18 |
|
* <p> |
19 |
|
* <b>Sample Usage</b> (Note that the following classes are all |
48 |
|
* return searcher.search(target); |
49 |
|
* }}); |
50 |
|
* </pre> |
49 |
– |
* @since 1.5 |
51 |
|
* @see FutureTask |
52 |
|
* @see Executor |
53 |
< |
* |
53 |
< |
* @spec JSR-166 |
54 |
< |
* @revised $Date$ |
55 |
< |
* @editor $Author$ |
53 |
> |
* @since 1.5 |
54 |
|
* @author Doug Lea |
55 |
|
*/ |
56 |
|
public interface Future<V> extends Cancellable { |