1 |
package java.lang; |
2 |
|
3 |
/** |
4 |
* A callable computes a function. |
5 |
* The <tt>Callable</tt> interface plays a role similar to that of |
6 |
* <tt>Runnable</tt>, except that it represents methods that |
7 |
* return results and (possibly) throw exceptions. |
8 |
* The <tt>Callable</tt> interface may be implemented by |
9 |
* any class with a method computing a function that can be invoked |
10 |
* in a "blind" fashion by some other execution agent, for |
11 |
* example a java.util.concurrent.Executor. |
12 |
* The most common implementations of Callable are inner classes |
13 |
* that supply arguments operated on by the function. |
14 |
* @see java.util.concurrent.Executor |
15 |
* @see java.util.concurrent.Future |
16 |
**/ |
17 |
public interface Callable { |
18 |
Object call() throws Exception; |
19 |
} |
20 |
|