标签:this ext pre ble hold color his add return
public V put(K key, V value) { //假如table为空 if (table == EMPTY_TABLE) { inflateTable(threshold); } //假如键为空 if (key == null) return putForNullKey(value); int hash = hash(key); int i = indexFor(hash, table.length); //遍历table[i] for (Entry<K,V> e = table[i]; e != null; e = e.next) { Object k; if (e.hash == hash && ((k = e.key) == key || key.equals(k))) { V oldValue = e.value; e.value = value; e.recordAccess(this); return oldValue; } } modCount++; //添加数组 addEntry(hash, key, value, i); return null; }
标签:this ext pre ble hold color his add return
原文地址:https://www.cnblogs.com/hellowzd/p/9723009.html