-
Holds cached entrySet(). Note that AbstractMap fields are used
-
for keySet() and values().
*/
// 保存缓的entrySet(),注意点 这个AbstractMap字段被用于keySet()和values()。
// 父类AbstractMap public abstract Set<Entry<K,V>> entrySet();
// -####拓展源码##----》当前类下搜索即可
transient Set<Map.Entry<K,V>> entrySet;
/**
-
Returns a {@link Set} view of the mappings contained in this map.
-
The set is backed by the map, so changes to the map are
-
reflected in the set, and vice-versa. If the map is modified
-
while an iteration over the set is in progress (except through
-
the iterator’s own remove operation, or through the
-
setValue operation on a map entry returned by the
-
iterator) the results of the iteration are undefined. The set
-
supports element removal, which removes the corresponding
-
mapping from the map, via the Iterator.remove,
-
Set.remove, removeAll, retainAll and
-
clear operations. It does not support the
-
add or addAll operations.
// 返回 这个map中包含的一个映射set视图
- @return a set view of the mappings contained in this map
*/
public Set<Map.Entry<K,V>> entrySet() {
Set<Map.Entry<K,V>> es;
return (es = entrySet) == null ? (entrySet = new EntrySet()) : es;
}
/**
- The number of key-value mappings contained in this map.
*/
// 这个map中包含的key-value的数量
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).
*/
// 这个map在结构上被修改的次数,结构修改是指那些改变hashMap的映射数量或
// 其他方式修改其内部结构的修改 例如:rehash。这个字段用于使HashMap集合视图上做迭代器操作的快速失败。
// 参考:ConcurrentModificationException
transient int modCount;
/**
-
The next size value at which to resize (capacity * load factor).
-
用于调整大小的下一个size的值 (容量*负载因子)
-
@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.)
// 如果数组table没有分配,此字段将保留初始数组容量,或使用零标志·表示 DEFAULT_INITIAL_CAPACITY
int threshold;
/**
-
The load factor for the hash table.
-
hash表的加载因子
最后
由于篇幅有限,这里就不一一罗列了,20道常见面试题(含答案)+21条MySQL性能调优经验小编已整理成Word文档或PDF文档
还有更多面试复习笔记分享如下
能调优经验**小编已整理成Word文档或PDF文档
[外链图片转存中…(img-A03dUyep-1714503368240)]
还有更多面试复习笔记分享如下
[外链图片转存中…(img-mXVakQwZ-1714503368240)]