HashMap/ArrayMap
来源:互联网 发布:程序员职业规划之道pdf 编辑:程序博客网 时间:2024/06/05 16:58
ArrayMap
ArrayMap is a generic key->value mapping data structure that is designed to bemore memory efficient than a traditional HashMap, this implementation is a version of the platform's ArrayMap that can be used on older versions of the platform. It keeps its mappings in an array data structure --an integer array of hash codes for each item, andan Object array of the key/value pairs. This allows it toavoid having to create an extra object for every entry put in to the map, and it also tries to control the growth of the size of these arrays more aggressively (since growing them only requires copying the entries in the array, not rebuilding a hash map).
If you don't need the standard Java container APIs provided here (iterators etc), consider using SimpleArrayMap instead.
Note that this implementation is not intended to be appropriate for data structures that may contain large numbers of items. It is generally slower than a traditional HashMap, since lookups require a binary search and adds and removes require inserting and deleting entries in the array. For containers holding up to hundreds of items, the performance difference is not significant, less than 50%.
Because this container is intended to better balance memory use, unlike most other standard Java containers it will shrink its array as items are removed from it. Currently you have no control over this shrinking -- if you set a capacity and then remove an item, it may reduce the capacity to better match the current size. In the future an explicit call to set the capacity should turn off this aggressive shrinking behavior.
- HashMap/ArrayMap
- SparseArray ArrayMap替代HashMap
- (HashMap,SparseArray,ArrayMap)
- SparseArray ArrayMap HashMap
- HashMap/ArrayMap/SparseArray讲解
- 合理使用ArrayMap代替HashMap
- HashMap、ArrayMap、SparseArray分析比较
- HashMap、ArrayMap、SparseArray分析比较
- HashMap和ArrayMap的区别
- android中SparseArray和ArrayMap代替HashMap
- 使用SparseArray和ArrayMap代替HashMap
- 数据结构HashMap(Android SparseArray 和ArrayMap)
- 使用SparseArray和ArrayMap代替HashMap
- 使用SparseArray和ArrayMap代替HashMap
- ArrayMap
- Android内存优化(使用SparseArray和ArrayMap代替HashMap)
- Android内存优化(使用SparseArray和ArrayMap代替HashMap)
- Android内存优化(使用SparseArray和ArrayMap代替HashMap)
- 初来乍到
- JAVA学习笔记之(四)函数
- || &&
- 8.15 C
- 手中无框架,心中有框架
- HashMap/ArrayMap
- Game of Sum UVA
- angular2 http post请求
- 接上一篇
- 1070. 结绳
- 本地jdk版本问题,没走java_home
- IDEA 2017 use JAVA_HOME(not defined yet)
- progeCAD 正版购买 中国 官方授权 代理商 经销商 网络版 专业版 公司授权
- 卓有成效的管理者(笔记)——要事优先