bamboo.util
Class LruMap

java.lang.Object
  extended by 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

Nested Class Summary
protected static class LruMap.MyIterator
           
protected static class LruMap.Node
           
 
Field Summary
protected  int capacity
           
protected  LruMap.Node first
           
protected  LruMap.Node last
           
protected  Map map
           
 
Constructor Summary
LruMap(int cap, Map backing_map)
           
 
Method Summary
protected  void add_n(LruMap.Node n)
           
 Map backing_map()
           
protected  void BUG(String msg)
           
 Object get(Object key)
           
 boolean isEmpty()
           
 Iterator iterator()
          Returns an iterator which walks through the set of items in the set, starting with the most recently added.
 Object lastKey()
           
 void put(Object key, Object value)
           
protected  void rem_n(LruMap.Node n)
           
 Object remove(Object key)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capacity

protected int capacity

map

protected Map map

first

protected LruMap.Node first

last

protected LruMap.Node last
Constructor Detail

LruMap

public LruMap(int cap,
              Map backing_map)
Method Detail

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)