Class LruHashMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.qiunet.utils.collection.lru.LruHashMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class LruHashMap<K,V> extends LinkedHashMap<K,V>
LruHashMap is an extension of Java's HashMap, which has a bounded size(); When it reaches that size, each time a new element is added, the least recently used (LRU) entry is removed. Java makes it very easy to implement LruHashMap - all its functionality is already available from LinkedHashMap, and we just need to configure that properly. Note that LruHashMap is thread safe
Author:
kinson
See Also: