public class LRU<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LRU(int max)
Create a new LRU.
|
LRU(int max,
ILRUEntryCleaner cleaner)
Create a new LRU.
|
Modifier and Type | Method and Description |
---|---|
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, get
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
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 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 © 2013. All Rights Reserved.