java.util.concurrent.Callable<V>
2014-03-08 15:23
597 查看
java.util.concurrent
Type Parameters:
All Known Subinterfaces:JavaCompiler.CompilationTask
A task that returns a result and may throw an exception. Implementors define a single method with no arguments called call.
The Callable interface is similar to
in that both are designed for classes whose instances are potentially executed by another thread.
A Runnable, however, does not return a result and cannot throw a checked exception.
The
contains utility methods to convert from other common forms to Callable classes.
Since:1.5
See Also:
Methods
Computes a result, or throws an exception if unable to do so.
Returns:computed result
Throws:
if unable to compute a result
Interface Callable<V>
Type Parameters:V- the result type of method call
All Known Subinterfaces:JavaCompiler.CompilationTask
public interface Callable<V>
A task that returns a result and may throw an exception. Implementors define a single method with no arguments called call.
The Callable interface is similar to
Runnable,
in that both are designed for classes whose instances are potentially executed by another thread.
A Runnable, however, does not return a result and cannot throw a checked exception.
The
Executorsclass
contains utility methods to convert from other common forms to Callable classes.
Since:1.5
See Also:
Executor
Method Summary
Modifier and Type | Method and Description |
---|---|
V | call() Computes a result, or throws an exception if unable to do so. |
Method Detail
call
V call() throws Exception
Computes a result, or throws an exception if unable to do so.
Returns:computed result
Throws:
Exception-
if unable to compute a result
相关文章推荐
- React Native 安卓真机测试报错 java.util.concurrent.ExecutionException:java.lang.RuntimeException:referenceError: can't find variable:_fbBatchedBridge(<unknown file>:1)
- Error:Tag <uses-permission> attribute name has invalid character '?'. Error:java.util.concurrent.Exe
- java.util.concurrent.Future<V>
- Java 线程之Thread,Runnable,Callable<T>
- Error:Execution failed for task ':app:mergeDebugResources'. > Error: Java.util.concurrent.ExecutionE
- 内功心法 -- java.util.LinkedList<E> (1)
- Java多线程Thread,Runnable, Callable<>和线程池(二)
- java数据结构:ConcurrentSkipListSet&lt;E&gt;与CopyOnWriteArraySet&lt;E&gt;
- java.util.concurrent中的Callable,Future
- java.util.concurrent.Callable
- 【Android API】java.util.List<E>
- java.util.concurrent包(4)――Callable和Future
- Unchecked cast: 'java.lang.Object' to 'java.util.List<java.lang.xxx>'
- java.util.concurrent.Callable, Runnable, Future,ExecutorService介绍
- java.lang.NoSuchMethodError: org.apache.hadoop.fs.FSOutputSummer.<init>(Ljava/util/zip/Checksum;II)V
- 内功心法 -- java.util.LinkedList<E> (2)
- java.util.Iterator<E>接口浅析
- java.util.Collection<E>接口
- 内功心法 -- java.util.ArrayList<E> (6)
- JDK源码(1.7) -- java.util.Collection<E>