|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.pastry.multiring.RingId
This class represents a ringId, which is based on a NodeId and represents a unique identifier for a ring.
Field Summary | |
static int |
ringIdBitLength
This is the bit length of the node ids. |
Constructor Summary | |
RingId()
Constructor. |
|
RingId(byte[] material)
Constructor. |
|
RingId(int[] material)
Constructor. |
Method Summary | |
void |
blit(byte[] target)
Blits the ringId into a target array. |
int |
compareTo(java.lang.Object obj)
Comparison operator for ringIds. |
byte[] |
copy()
Copy the ringId into a freshly generated array. |
boolean |
equals(java.lang.Object obj)
Equality operator for ringIds. |
boolean |
equals(rice.pastry.multiring.RingId nid)
Equivalence relation for ringIds. |
int |
getDigit(int i,
int b)
Gets the ith digit in base 2^b. |
int |
hashCode()
Hash codes for ringIds. |
static int |
numDigits(int base)
return the number of digits in a given base |
rice.pastry.NodeId |
toNodeId()
Copy the ringId into a new Nodeid |
java.lang.String |
toString()
Returns a string representation of the ringId in base 16. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ringIdBitLength
Constructor Detail |
public RingId(byte[] material)
material
- an array of length at least ringIdBitLength/8 containing raw ringId material.public RingId(int[] material)
material
- an array of length at least ringIdBitLength/32 containing raw ringId material.public RingId()
Method Detail |
public void blit(byte[] target)
target
- an array of length at least ringIdBitLength/8 for the ringId to be stored in.public rice.pastry.NodeId toNodeId()
public byte[] copy()
public static int numDigits(int base)
base
- the number of bits in the base
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- a ringId object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- the RingId to compare with.
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(rice.pastry.multiring.RingId nid)
nid
- the other node id.
public int getDigit(int i, int b)
i
- which digit to get.b
- which power of 2 is the base to get it in.
public java.lang.String toString()
toString
in class java.lang.Object
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |