30 |
|
* class App { |
31 |
|
* ExecutorService executor = ... |
32 |
|
* ArchiveSearcher searcher = ... |
33 |
< |
* void showSearch(final String target) throws InterruptedException { |
34 |
< |
* Future<String> future = executor.submit(new Callable<String>() { |
33 |
> |
* void showSearch(final String target) |
34 |
> |
* throws InterruptedException { |
35 |
> |
* Future<String> future |
36 |
> |
* = executor.submit(new Callable<String>() { |
37 |
|
* public String call() { return searcher.search(target); } |
38 |
|
* }); |
39 |
|
* displayOtherThings(); // do other things while searching |
97 |
|
* cancellation -- in all of these cases, this method will return |
98 |
|
* <tt>true</tt>. |
99 |
|
* |
100 |
< |
* @return <tt>true</tt> if this task completed. |
100 |
> |
* @return <tt>true</tt> if this task completed |
101 |
|
*/ |
102 |
|
boolean isDone(); |
103 |
|
|