equal
deleted
inserted
replaced
235 * Called by superclass constructors and pseudoconstructors (clone, |
235 * Called by superclass constructors and pseudoconstructors (clone, |
236 * readObject) before any entries are inserted into the map. Initializes |
236 * readObject) before any entries are inserted into the map. Initializes |
237 * the chain. |
237 * the chain. |
238 */ |
238 */ |
239 void init() { |
239 void init() { |
240 header = new Entry<K,V>(-1, null, null, null); |
240 header = new Entry<>(-1, null, null, null); |
241 header.before = header.after = header; |
241 header.before = header.after = header; |
242 } |
242 } |
243 |
243 |
244 /** |
244 /** |
245 * Transfers all entries to new table array. This method is called |
245 * Transfers all entries to new table array. This method is called |
436 * This override differs from addEntry in that it doesn't resize the |
436 * This override differs from addEntry in that it doesn't resize the |
437 * table or remove the eldest entry. |
437 * table or remove the eldest entry. |
438 */ |
438 */ |
439 void createEntry(int hash, K key, V value, int bucketIndex) { |
439 void createEntry(int hash, K key, V value, int bucketIndex) { |
440 HashMap.Entry<K,V> old = table[bucketIndex]; |
440 HashMap.Entry<K,V> old = table[bucketIndex]; |
441 Entry<K,V> e = new Entry<K,V>(hash, key, value, old); |
441 Entry<K,V> e = new Entry<>(hash, key, value, old); |
442 table[bucketIndex] = e; |
442 table[bucketIndex] = e; |
443 e.addBefore(header); |
443 e.addBefore(header); |
444 size++; |
444 size++; |
445 } |
445 } |
446 |
446 |