hashMap 属性说明
2016-03-10 16:05
218 查看
public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable { /** * The default initial capacity - MUST be a power of two. */ static final int DEFAULT_INITIAL_CAPACITY = 16;//默认初始容量(数组大小) /** * The maximum capacity, used if a higher value is implicitly specified * by either of the constructors with arguments. * MUST be a power of two <= 1<<30. */ static final int MAXIMUM_CAPACITY = 1 << 30;//1073741824最大的容量范围 /** * The load factor used when none specified in constructor. */ static final float DEFAULT_LOAD_FACTOR = 0.75f;//加载因子默认0.75 /** * The table, resized as necessary. Length MUST Always be a power of two. */ transient Entry[] table;//存储数据的entry数组 /** * The number of key-value mappings contained in this map. */ transient int size;//数组的大小 /** * The next size value at which to resize (capacity * load factor). * @serial */ int threshold;//临界值=加载因子*初始容量(当size大于临界值就会出现数组扩充到原来2 倍) /** * The load factor for the hash table. * * @serial */ final float loadFactor;//加载因子默认0.75 /** * The number of times this HashMap has been structurally modified * Structural modifications are those that change the number of mappings in * the HashMap or otherwise modify its internal structure (e.g., * rehash). This field is used to make iterators on Collection-views of * the HashMap fail-fast. (See ConcurrentModificationException). */ transient volatile int modCount;//修改的次数
相关文章推荐
- java 序列化之当序列化遭遇继承,组合,对象引用
- HttpClient连接池的三篇文章
- 系统架构图
- JMeter
- js json 增删改查
- 设置HtmlUnitDriver代理及处理用户验证问题
- java 序列化之当序列化遭遇继承
- httpclient http连接池 源码阅读
- mongoDB--GridFS简介
- 持续集成hudson入门
- sun BASE64Decoder 抽取
- java 数据存储 bit
- MMSegAnalyzer 自定义 同义词分词器
- 序列化框架比较:kryo &amp; hessian &amp; Protostuff &amp; java
- httpclient post 中文问题
- dns
- htmlunit 模拟登陆 https
- java如何交换这两个变量的值方法
- Jest
- Java Reference引用 强引用 软引用 弱引用 虚引用