bamboo.util
Class LruMap
java.lang.Object
bamboo.util.LruMap
public class LruMap
- extends Object
An set with an attached LRU ordering.
- Version:
- $Id: LruMap.java,v 1.2 2004/02/10 21:26:26 srhea Exp $
- Author:
- Sean C. Rhea
|
Constructor Summary |
LruMap(int cap,
Map backing_map)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
capacity
protected int capacity
map
protected Map map
first
protected LruMap.Node first
last
protected LruMap.Node last
LruMap
public LruMap(int cap,
Map backing_map)
size
public int size()
isEmpty
public boolean isEmpty()
backing_map
public Map backing_map()
iterator
public Iterator iterator()
- Returns an iterator which walks through the set of items in the set,
starting with the most recently added.
put
public void put(Object key,
Object value)
get
public Object get(Object key)
lastKey
public Object lastKey()
remove
public Object remove(Object key)
rem_n
protected void rem_n(LruMap.Node n)
add_n
protected void add_n(LruMap.Node n)
BUG
protected void BUG(String msg)