public class LRUMap<K,V> extends LinkedHashMap<K,V> implements Serializable
Note that serialization behavior is such that contents are NOT serialized, on assumption that all use cases are for caching where persistence does not make sense. The only thing serialized is the cache size of Map.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected int |
_jdkSerializeMaxEntries
Ugly hack, to work through the requirement that _value is indeed final,
and that JDK serialization won't call ctor(s) if Serializable is implemented.
|
protected int |
_maxEntries |
Constructor and Description |
---|
LRUMap(int initialEntries,
int maxEntries) |
Modifier and Type | Method and Description |
---|---|
protected Object |
readResolve() |
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
clear, containsValue, get
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
protected final int _maxEntries
protected transient int _jdkSerializeMaxEntries
protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
protected Object readResolve()
Copyright © 2012-2013 FasterXML. All Rights Reserved.