org.lobobrowser.util

Class LRUCache

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

Nested Class Summary

static class
LRUCache.EntryInfo

Constructor Summary

LRUCache(int approxMaxSize)

Method Summary

void
addRemovalListener(RemovalListener listener)
Object
get(Object key)
int
getApproxMaxSize()
int
getApproxSize()
List
getEntryInfoList()
int
getNumEntries()
void
put(Object key, Object value, int approxSize)
Object
remove(Object key)
void
removeRemovalListener(RemovalListener listener)
void
setApproxMaxSize(int approxMaxSize)

Constructor Details

LRUCache

public LRUCache(int approxMaxSize)

Method Details

addRemovalListener

public void addRemovalListener(RemovalListener listener)

get

public Object get(Object key)

getApproxMaxSize

public int getApproxMaxSize()

getApproxSize

public int getApproxSize()

getEntryInfoList

public List getEntryInfoList()

getNumEntries

public int getNumEntries()

put

public void put(Object key,
                Object value,
                int approxSize)

remove

public Object remove(Object key)

removeRemovalListener

public void removeRemovalListener(RemovalListener listener)

setApproxMaxSize

public void setApproxMaxSize(int approxMaxSize)