bamboo.router
Class LeafSet

java.lang.Object
  extended by bamboo.router.LeafSet

public class LeafSet
extends Object

Manages the leaf set for node.

Version:
$Id: LeafSet.java,v 1.25 2003/12/20 02:40:55 srhea Exp $
Author:
Sean C. Rhea

Field Summary
protected  int leaf_pred_count
           
protected  NeighborInfo[] leaf_preds
           
protected  int leaf_set_size
           
protected  int leaf_succ_count
           
protected  NeighborInfo[] leaf_succs
           
protected  BigInteger MODULUS
           
protected  BigInteger my_guid
           
protected  NeighborInfo my_neighbor_info
           
static int REMOVED_BOTH
           
static int REMOVED_NONE
           
static int REMOVED_PREDECESSOR
           
static int REMOVED_SUCCESSOR
           
 
Constructor Summary
LeafSet(NeighborInfo ni, int sz, BigInteger mod)
           
 
Method Summary
 NeighborInfo add_node(NeighborInfo ni)
           
 LinkedList as_list()
           
 Set as_set()
           
 BigInteger calc_dist(BigInteger a, BigInteger b)
           
 NeighborInfo closest_leaf(BigInteger guid, Set ignore)
           
 boolean contains(NeighborInfo ni)
           
protected  boolean in_range_mod(BigInteger low, BigInteger high, BigInteger query)
           
 Set intermediates(BigInteger other)
          Returns a set of the nodes between us and the given node in our leaf set, or null if none exist.
 BigInteger leaf_set_high()
           
 BigInteger leaf_set_low()
           
 BambooNeighborInfo[] preds()
           
 boolean promising(NeighborInfo ni)
           
 NeighborInfo random_member(Random rand)
           
 int remove_node(NeighborInfo ni)
           
 BambooNeighborInfo[] succs()
           
 String toString()
           
 boolean within_leaf_set(BigInteger i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MODULUS

protected BigInteger MODULUS

my_guid

protected BigInteger my_guid

my_neighbor_info

protected NeighborInfo my_neighbor_info

leaf_preds

protected NeighborInfo[] leaf_preds

leaf_succs

protected NeighborInfo[] leaf_succs

leaf_set_size

protected int leaf_set_size

leaf_pred_count

protected int leaf_pred_count

leaf_succ_count

protected int leaf_succ_count

REMOVED_NONE

public static final int REMOVED_NONE
See Also:
Constant Field Values

REMOVED_PREDECESSOR

public static final int REMOVED_PREDECESSOR
See Also:
Constant Field Values

REMOVED_SUCCESSOR

public static final int REMOVED_SUCCESSOR
See Also:
Constant Field Values

REMOVED_BOTH

public static final int REMOVED_BOTH
See Also:
Constant Field Values
Constructor Detail

LeafSet

public LeafSet(NeighborInfo ni,
               int sz,
               BigInteger mod)
Method Detail

random_member

public NeighborInfo random_member(Random rand)

as_list

public LinkedList as_list()

preds

public BambooNeighborInfo[] preds()

succs

public BambooNeighborInfo[] succs()

as_set

public Set as_set()

intermediates

public Set intermediates(BigInteger other)
Returns a set of the nodes between us and the given node in our leaf set, or null if none exist.


contains

public boolean contains(NeighborInfo ni)

promising

public boolean promising(NeighborInfo ni)

add_node

public NeighborInfo add_node(NeighborInfo ni)

remove_node

public int remove_node(NeighborInfo ni)

toString

public String toString()
Overrides:
toString in class Object

calc_dist

public BigInteger calc_dist(BigInteger a,
                            BigInteger b)

closest_leaf

public NeighborInfo closest_leaf(BigInteger guid,
                                 Set ignore)

within_leaf_set

public final boolean within_leaf_set(BigInteger i)

leaf_set_low

public final BigInteger leaf_set_low()

leaf_set_high

public final BigInteger leaf_set_high()

in_range_mod

protected boolean in_range_mod(BigInteger low,
                               BigInteger high,
                               BigInteger query)