|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.pastry.LeafSet
public class LeafSet
LeafSet class encapsulate functionalities of a Leaf Set table in a Pastry Node, allowing automatic "intellingent" adding of the entries, and facilitating extraction of information
Title: MSPASTRY
Description: MsPastry implementation for PeerSim
Copyright: Copyright (c) 2007
Company: The Pastry Group
Field Summary | |
---|---|
static int |
BIN
shortcut to base-representation specifier |
static int |
DEC
shortcut to base-representation specifier |
static int |
HEX
shortcut to base-representation specifier |
int |
hsize
size of both left and right part of the leaf set. |
static int |
NIB
shortcut to base-representation specifier |
java.math.BigInteger |
nodeId
pivot nodeId, this is needed in order to know how to organize adding/positioning/searching of the entries of the leaf set |
Constructor Summary | |
---|---|
LeafSet(java.math.BigInteger myNodeId,
int size)
Creates a new Leaf Set by pivoting it with the specified nodeId, and with the desired size of the vector. |
|
LeafSet(long myNodeId,
int size)
shortcut constructor to use integers instead of BigIntegers. |
Method Summary | |
---|---|
java.lang.Object |
clone()
produces an exact deep clone of this Object, everything is copied |
boolean |
containsNodeId(java.math.BigInteger node)
returns true iff whe specified node is found in the table |
boolean |
encompass(java.math.BigInteger k)
returns true if key is between the leftmost and the rightmost. |
java.math.BigInteger[] |
listAllNodes()
Outputs an (ordered, from min to max) array of all nodes in the leaf set. |
void |
push(java.math.BigInteger newNode)
push into the leafset the specified node, by according the properties specified by the mspastry protocol |
void |
push(long newNode)
shortcut for push(new BigInteger(""+newNode)); |
boolean |
removeNodeId(java.math.BigInteger b)
permanently removes the specified NodeId from this Leaf Set. |
java.lang.String |
toString()
Outputs a representation of this leafset in the form: [L3;L2;L1;L0]pivot[R0;R1;R2;R3] each entry is represented only partially, to allow a shorter represantation (i.e. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int hsize
public java.math.BigInteger nodeId
public static final int HEX
public static final int DEC
public static final int NIB
public static final int BIN
Constructor Detail |
---|
public LeafSet(long myNodeId, int size)
myNodeId
- longsize
- intpublic LeafSet(java.math.BigInteger myNodeId, int size)
myNodeId
- BigInteger the pivot nodeId of the leafset, i.e. the nodeid of the pastry
node ownersize
- int must be > 0, and possibily an even numberMethod Detail |
---|
public boolean removeNodeId(java.math.BigInteger b)
b
- BigInteger
public void push(long newNode)
newNode
- longpublic void push(java.math.BigInteger newNode)
newNode
- longpublic boolean containsNodeId(java.math.BigInteger node)
node
- BigInteger
public boolean encompass(java.math.BigInteger k)
k
- BigInteger
public java.math.BigInteger[] listAllNodes()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
[L3;L2;L1;L0]pivot[R0;R1;R2;R3]
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |