|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoogp2p.chord.ChordLocation
ChordLocation. Adapted from Stuart Anderson's implementation of ChordLocation
| Field Summary | |
private java.lang.String |
IPAddr
|
private byte[] |
key
|
private static java.security.MessageDigest |
md
|
static int |
NUM_HASH_BYTES
|
private int |
port
|
| Constructor Summary | |
|
ChordLocation(byte[] bs)
|
(package private) |
ChordLocation(java.lang.String IP,
int p)
This is the basic constructor - it calculates the key for a node. |
| Method Summary | |
java.lang.String |
addr()
This selector returns the IP address of the node. |
static int |
convbyte(byte b)
|
java.lang.String |
displayIdAsBytes()
|
boolean |
equals(ChordLocation l1)
An equality test for locations. |
static byte[] |
getHash(java.lang.String item)
|
java.math.BigInteger |
getIdAsBigInt()
|
byte[] |
id()
This selector returns the value of the SHA key for the node. |
boolean |
isBetween(ChordLocation left,
ChordLocation right)
|
boolean |
lessThan(ChordLocation l1)
Compare the keys of two locations....are you less than l1? |
int |
portNo()
This selector returns the port number of the location. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String IPAddr
private int port
private byte[] key
public static int NUM_HASH_BYTES
private static java.security.MessageDigest md
| Constructor Detail |
ChordLocation(java.lang.String IP,
int p)
public ChordLocation(byte[] bs)
bs - | Method Detail |
public static byte[] getHash(java.lang.String item)
public byte[] id()
public java.lang.String addr()
public int portNo()
public static int convbyte(byte b)
b -
public boolean equals(ChordLocation l1)
public java.lang.String displayIdAsBytes()
public boolean lessThan(ChordLocation l1)
public java.math.BigInteger getIdAsBigInt()
public boolean isBetween(ChordLocation left,
ChordLocation right)
left - right -
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||