org.apache.activemq.util
Class LRUCache
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
org.apache.activemq.util.LRUCache
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class LRUCache
- extends LinkedHashMap
A Simple LRU Cache
- Version:
- $Revision$
- See Also:
- Serialized Form
Constructor Summary |
LRUCache()
Constructs LRU Cache |
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
maxCacheSize
protected int maxCacheSize
LRUCache
public LRUCache()
- Constructs LRU Cache
getMaxCacheSize
public int getMaxCacheSize()
- Returns:
- Returns the maxCacheSize.
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize)
- Parameters:
maxCacheSize
- The maxCacheSize to set.
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry entry)
- Overrides:
removeEldestEntry
in class LinkedHashMap
Copyright © 2011 Apache Software Foundation. All Rights Reserved.