efficom.runningjoe.services
Class LRUCache<K,V>
java.lang.Object
efficom.runningjoe.services.LRUCache<K,V>
public class LRUCache<K,V>
- extends java.lang.Object
A simple implementation of an LRU cache.
Retrieved from Stackoverflow.
Constructor Summary |
LRUCache(int maxEntries)
Creates the cache with the specified max entries. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LRUCache
public LRUCache(int maxEntries)
- Creates the cache with the specified max entries.
add
public void add(K key,
V value)
get
public V get(K key)
retrieveAll
public java.util.Collection<V> retrieveAll()
setEntryRemovedListener
public void setEntryRemovedListener(LRUCache.CacheEntryRemovedListener<K,V> entryRemovedListener)