我有一个可调用对象的列表,我正在使用这些对象来生成将来的对象的列表。我正在使用ExecutorService来同时完成Callable任务,并将结果存储为Future对象的列表。现在我想知道,有没有一种方法可以使我获得用于生成给定未来对象的原始可调用对象。
2 回答
![?](http://img1.sycdn.imooc.com/533e4d00000171e602000200-100-100.jpg)
繁华开满天机
TA贡献1816条经验 获得超4个赞
如果Future通过调用获得,则ExecutorService.invokeAll()可以依赖javadoc中记录的顺序。
* @return a list of Futures representing the tasks, in the same
* sequential order as produced by the iterator for the
* given task list, each of which has completed
添加回答
举报
0/150
提交
取消