bamboo.router
Class LocationCache
java.lang.Object
bamboo.router.LocationCache
public class LocationCache
- extends Object
A Chord-like location cache; for use in performance evaluations.
- Version:
- $Id: LocationCache.java,v 1.9 2003/10/05 23:26:52 srhea Exp $
- Author:
- Sean C. Rhea
MODULUS
protected BigInteger MODULUS
capacity
protected int capacity
cache
protected SortedMap cache
first
protected LocationCache.Node first
last
protected LocationCache.Node last
LocationCache
public LocationCache(int cap,
BigInteger mod)
size
public int size()
iterator
public Iterator iterator()
- Returns an iterator which walks through the set of nodes in the cache,
starting with the most recently added.
add_node
public void add_node(NeighborInfo ni)
remove_node
public boolean remove_node(NeighborInfo ni)
toString
public String toString()
- Overrides:
toString in class Object
closest_node
public NeighborInfo closest_node(BigInteger guid)
calc_dist
protected BigInteger calc_dist(BigInteger a,
BigInteger b)
rem_n
protected void rem_n(LocationCache.Node n)
BUG
protected void BUG(String msg)