ArrayMAP介绍
来源:互联网 发布:4y4淘宝装修平台 编辑:程序博客网 时间:2024/05/21 04:38
它不是一个适应大数据的数据结构,相比传统的HashMap速度要慢,因为查找方法是二分法,并且当你删除或者添加数据时,会对空间重新调整,在使用大量数据时,效率并不明显,低于50%。
ArrayMap is a generic key->value mapping data structure that is designed to be more memory efficient than a traditional
. 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 to avoid 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).java.util.HashMap
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.
public final class ArrayMap<K, V> implements Map<K, V> {
Object[] mArray; //,mArray中就是键值对,每两个元素代表一个键值对,前面保存key,后面的保存value
}
public interface MAP<K,V> {
int size();
boolean isEmpty();
boolean containsKey(Object key);
boolean containsVlaue(Object value);
V get(Object key);
V put(K key, V value);
V remove(Object key);
void putAll(Map<? extends K, ? extends V> m);
void clear();
Set<K> keySet();
Collection<V> values();
boolean equals(Object o);
int hasCode();
}
- ArrayMAP介绍
- ArrayMap
- HashMap/ArrayMap
- ArrayMap源码阅读
- android.util.ArrayMap 解读
- Android内存优化:ArrayMap
- Android SparseArray ArrayMap
- Android ArrayMap源码详解
- Android优化之ArrayMap
- ArrayMap代码分析
- ArrayMap源码分析
- 深入分析ArrayMap
- SparseArray和ArrayMap
- SparseArray ArrayMap替代HashMap
- (HashMap,SparseArray,ArrayMap)
- SparseArray ArrayMap HashMap
- HashMap/ArrayMap/SparseArray讲解
- android的ArrayMap类
- angularjs里 什么时候加{{}} 什么时候不用?
- OkHttp的使用
- [最大费用最大流] [记忆化搜索] [Vijos P1653] 疯狂的方格取数 (getnum)
- Canbus通信协议
- 点分治练习poj1741;poj2114;bzoj2599
- ArrayMAP介绍
- EventBus基础教程解析
- Android Studio 下无法调用org.apache。。类的解决方法
- c++/c 产生随机数
- struts2的核心和工作原理
- nginx初探-安装部署
- <Sicily>Fibonacci
- DNS数据包
- 游戏中的AI算法总结与改进