我想在相应的索引中存储整数的计数。能够并行更新计数。我已经找到了java.util.concurrent.atomic.AtomicIntegerArray,但是通过API获取底层数组是不可能的(我最终想映射到这个数组上)
发布于 2017-02-04 15:04:17
因为AtomicIntegerArray支持length方法,所以我们可以遍历它,如下所示。(使用scala)
(0 to atomicIntegerArray.length()-1)
.map(atomicIntegerArray.get)
.map( x => /*your map logic*/ )https://stackoverflow.com/questions/42037523
复制相似问题