/**
* 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;
接下来是负载因子,默认值为0.75f。
/**
* the load factor used when none specified in constructor.
**/
static final float default_load_factor = 0.75f;
/**
* the bin count threshold for using a tree rather than list for a
* bin. bins are converted to trees when adding an element to a
* bin with at least this many nodes. the value must be greater
* than 2 and should be at least 8 to mesh with assumptions in
* tree removal about conversion back to plain bins upon
* shrinkage.
**/
static final int treeify_threshold = 8;
/**
* the bin count threshold for untreeifying a (split) bin during a
* resize operation. should be less than treeify_threshold, and at
* most 6 to mesh with shrinkage detection under removal.
**/
static final int untreeify_threshold = 6;
/**
* the smallest table capacity for which bins may be treeified.
* (otherwise the table is resized if too many nodes in a bin.)
* should be at least 4 * treeify_threshold to avoid conflicts
* between resizing and treeification thresholds.
**/
static final int min_treeify_capacity = 64;
/**
* the table, initialized on first use, and resized as
* necessary. when allocated, length is always a power of two.
* (we also tolerate length zero in some operations to allow
* bootstrapping mechanics that are currently not needed.)
**/
transient node<k,v>[] table;
/**
* the number of key-value mappings contained in this map.
**/
transient int size;
/**
* 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 int modcount;
/**
* the next size value at which to resize (capacity * load factor).
* @serial
**/
// (the javadoc description is true upon serialization.
// additionally, if the table array has not been allocated, this
// field holds the initial array capacity, or zero signifying
// default_initial_capacity.)
int threshold;
/**
* the load factor for the hash table.
*
* @serial
**/
final float loadfactor;
this is the end. 总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对CodeAE代码之家的支持。如果你想了解更多相关内容请查看下面相关链接
原文链接:https://blog.csdn.net/li_canhui/article/details/85088659