bamboo.router
Class LeafSet
java.lang.Object
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
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
LeafSet
public LeafSet(NeighborInfo ni,
int sz,
BigInteger mod)
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)