K - key 泛型V - value 泛型public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 限定符和类型 | 方法和说明 |
|---|---|
Set<Map.Entry<K,V>> |
entrySet() |
V |
put(K key,
V value)
存储一个值
|
void |
putAll(Map<? extends K,? extends V> m)
批量添加,为了避免多次 rehash 可以首先扩容完成后,在进行相关元素的存储。
|
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, remove, size, toString, valuesclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesCopyright © 2020. All rights reserved.