org.lobobrowser.util
Class LRUCache
java.lang.Object
org.lobobrowser.util.LRUCache
- All Implemented Interfaces:
- java.io.Serializable
public class LRUCache
- extends java.lang.Object
- implements java.io.Serializable
A cache with least-recently-used policy.
Note that this class is not thread safe by itself.
- See Also:
- Serialized Form
Constructor Summary |
LRUCache(int approxMaxSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LRUCache
public LRUCache(int approxMaxSize)
getApproxMaxSize
public int getApproxMaxSize()
setApproxMaxSize
public void setApproxMaxSize(int approxMaxSize)
put
public void put(java.lang.Object key,
java.lang.Object value,
int approxSize)
get
public java.lang.Object get(java.lang.Object key)
remove
public java.lang.Object remove(java.lang.Object key)
addRemovalListener
public void addRemovalListener(RemovalListener listener)
removeRemovalListener
public void removeRemovalListener(RemovalListener listener)
getApproxSize
public int getApproxSize()
getNumEntries
public int getNumEntries()
getEntryInfoList
public java.util.List getEntryInfoList()