protected Entry<K, V> removeEntry(Entry<K, V> pEntry) { Entry<K, V> entry = super.removeEntry(pEntry); processRemoved(pEntry); return entry; }
public V put(K pKey, V pValue) { LinkedEntry<K, V> entry = (LinkedEntry<K, V>) entries.get(pKey); V oldValue; if (entry == null) { oldValue = null; // Remove eldest entry if instructed, else grow capacity if appropriate LinkedEntry<K, V> eldest = head.next; if (removeEldestEntry(eldest)) { removeEntry(eldest); } entry = createEntry(pKey, pValue); entry.addBefore(head); entries.put(pKey, entry); } else { oldValue = entry.mValue; entry.mValue = pValue; entry.recordAccess(this); } modCount++; return oldValue; }
protected Entry<K, V> removeEntry(Entry<K, V> pEntry) { Entry<K, V> entry = super.removeEntry(pEntry); processRemoved(pEntry); return entry; }
protected Entry<K, V> removeEntry(Entry<K, V> pEntry) { Entry<K, V> entry = super.removeEntry(pEntry); processRemoved(pEntry); return entry; }
protected Entry<K, V> removeEntry(Entry<K, V> pEntry) { Entry<K, V> entry = super.removeEntry(pEntry); processRemoved(pEntry); return entry; }
public V put(K pKey, V pValue) { LinkedEntry<K, V> entry = (LinkedEntry<K, V>) mEntries.get(pKey); V oldValue; if (entry == null) { oldValue = null; // Remove eldest entry if instructed, else grow capacity if appropriate LinkedEntry<K, V> eldest = mHead.mNext; if (removeEldestEntry(eldest)) { removeEntry(eldest); } entry = createEntry(pKey, pValue); entry.addBefore(mHead); mEntries.put(pKey, entry); } else { oldValue = entry.mValue; entry.mValue = pValue; entry.recordAccess(this); } mModCount++; return oldValue; }
public V put(K pKey, V pValue) { LinkedEntry<K, V> entry = (LinkedEntry<K, V>) entries.get(pKey); V oldValue; if (entry == null) { oldValue = null; // Remove eldest entry if instructed, else grow capacity if appropriate LinkedEntry<K, V> eldest = head.next; if (removeEldestEntry(eldest)) { removeEntry(eldest); } entry = createEntry(pKey, pValue); entry.addBefore(head); entries.put(pKey, entry); } else { oldValue = entry.mValue; entry.mValue = pValue; entry.recordAccess(this); } modCount++; return oldValue; }
public V put(K pKey, V pValue) { LinkedEntry<K, V> entry = (LinkedEntry<K, V>) entries.get(pKey); V oldValue; if (entry == null) { oldValue = null; // Remove eldest entry if instructed, else grow capacity if appropriate LinkedEntry<K, V> eldest = head.next; if (removeEldestEntry(eldest)) { removeEntry(eldest); } entry = createEntry(pKey, pValue); entry.addBefore(head); entries.put(pKey, entry); } else { oldValue = entry.mValue; entry.mValue = pValue; entry.recordAccess(this); } modCount++; return oldValue; }