摘要:
1 public V get(Object key) { 2 Node<K,V>[] tab; Node<K,V> e, p; int n, eh; K ek; 3 //寻址 4 int h = spread(key.hashCode()); 5 if ((tab = table) != null && (n = tab.length) > 0 && 6 (e = tabAt(tab, (n - 阅读全文
摘要:
1 /** 2 key:键值 3 value:值 4 onlyIfAbsent:true:如果key存在的情况下,不更新值;Flase:如果key存在的情况下,替换old value 5 **/ 6 final V putVal(K key, V value, boolean onlyIfAbsent) { 7 //不允许key或value为空 8 if (key == null || value 阅读全文