public class LRU<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LRU()
Create a new LRU with 1000 entries.
|
LRU(int max)
Create a new LRU.
|
LRU(int max,
ILRUEntryCleaner cleaner)
Create a new LRU.
|
| Modifier and Type | Method and Description |
|---|---|
ILRUEntryCleaner |
getCleaner()
Get the cleaner object.
|
int |
getMaxEntries()
Get the maximum number of the
|
boolean |
removeEldestEntry(Map.Entry<K,V> eldest)
Remove the eldest entry.
|
void |
setCleaner(ILRUEntryCleaner cleaner)
Set the cleaner object.
|
void |
setMaxEntries(int max)
Set the maximum number of entries.
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic LRU()
public LRU(int max)
max - The maximum number of entries.public LRU(int max,
ILRUEntryCleaner cleaner)
max - The maximum number of entries.public int getMaxEntries()
public void setMaxEntries(int max)
max - The maximum number of entries.public ILRUEntryCleaner getCleaner()
public void setCleaner(ILRUEntryCleaner cleaner)
cleaner - The cleaner object.public boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry in class LinkedHashMap<K,V>eldest - The eldest entry.Copyright © 2015. All Rights Reserved.