slicing
Interface SortedRing


public interface SortedRing


Field Summary
static int NEXT
          Successor direction in the ring
static int PREV
          Predecessor direction in the ring
 
Method Summary
 peersim.core.Node getLeaf(int dir, int i)
          Return the i-th neighbor in the specified direction.
 int leafDegree()
          Returns the number of neighbors in each direction.
 void setLeaf(int dir, int i, peersim.core.Node node)
          Store a node as the i-th leaf in the specified direction.
 

Field Detail

PREV

static final int PREV
Predecessor direction in the ring

See Also:
Constant Field Values

NEXT

static final int NEXT
Successor direction in the ring

See Also:
Constant Field Values
Method Detail

getLeaf

peersim.core.Node getLeaf(int dir,
                          int i)
Return the i-th neighbor in the specified direction.

Parameters:
dir - the direction in the ring
i - the index of neighborhood, starting from 0

setLeaf

void setLeaf(int dir,
             int i,
             peersim.core.Node node)
Store a node as the i-th leaf in the specified direction.

Parameters:
dir - the direction in the ring
i - the index of neighborhood, starting from 0
node - the node to be stored

leafDegree

int leafDegree()
Returns the number of neighbors in each direction.