我正在开发Android应用程序,其中我使用HashTable存储KeyValue对.在某些阶段,我必须根据键检索所有值.(我没有安全问题).HashTable没有满足性能,因为随着迭代次数的增加,它开始花费更多的时间.在Google上进行了一些搜索之后,我开始了解关于存储KeyValue的两个Apis.
Apache Commons Collection
谷歌番石榴收藏
我也检查了这个问题 Apache Commons vs. Guava(以前称为"Google Collections")
但我想解释更多只是通用支持差异,因为在我的情况下我只是使用String,String为keyValue对.
我应该使用其中任何一个,还是应该使用HashMap.
此链接解释了HashMap,Apache Commons,Google Guav集合的简单示例. http://java.dzone.com/articles/hashmap-%E2%80%93-single-key-and
我有一个数字矩阵,我想将rpois应用于矩阵的每个元素.矩阵看起来像这样
[1,] 112 119 222 85 101 99
[2,] 117 154 205 123 113 133
[3,] 28708 19994 33608 21151 11579 15436
[4,] 0 6 16 0 0 7
Run Code Online (Sandbox Code Playgroud)
如何将rpois函数应用于矩阵的每个元素?