|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.glacier.VersionKey
public class VersionKey
DESCRIBE THE CLASS
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface rice.p2p.commonapi.Id |
---|
Id.Distance |
Field Summary | |
---|---|
protected Id |
id
DESCRIBE THE FIELD |
static short |
TYPE
|
protected long |
version
DESCRIBE THE FIELD |
Constructor Summary | |
---|---|
VersionKey(Id id,
long version)
Constructor for VersionKey. |
|
VersionKey(InputBuffer buf,
Endpoint endpoint)
|
Method Summary | |
---|---|
Id |
addToId(Id.Distance offset)
Returns an Id corresponding to this Id plus a given distance |
static VersionKey |
build(java.lang.String s)
|
boolean |
clockwise(Id nid)
Checks to see if the Id nid is clockwise or counterclockwise from this, on the ring. |
int |
compareTo(Id o)
DESCRIBE THE METHOD |
Id.Distance |
distanceFromId(Id nid)
Returns the shorter numerical distance on the ring between a pair of Ids. |
boolean |
equals(java.lang.Object peer)
DESCRIBE THE METHOD |
int |
getByteArrayLength()
Returns the length of the byte[] representing this Id |
Id |
getId()
Gets the Id attribute of the VersionKey object |
short |
getType()
|
long |
getVersion()
Gets the Version attribute of the VersionKey object |
int |
hashCode()
DESCRIBE THE METHOD |
boolean |
isBetween(Id ccw,
Id cw)
Checks if this Id is between two given ids ccw (inclusive) and cw (exclusive) on the circle |
Id.Distance |
longDistanceFromId(Id nid)
Returns the longer numerical distance on the ring between a pair of Ids. |
void |
serialize(OutputBuffer buf)
Serialize |
byte[] |
toByteArray()
DESCRIBE THE METHOD |
void |
toByteArray(byte[] result,
int offset)
Stores the byte[] value of this Id in the provided byte array |
java.lang.String |
toString()
DESCRIBE THE METHOD |
java.lang.String |
toStringFull()
DESCRIBE THE METHOD |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short TYPE
protected Id id
protected long version
Constructor Detail |
---|
public VersionKey(Id id, long version)
id
- DESCRIBE THE PARAMETERversion
- DESCRIBE THE PARAMETERpublic VersionKey(InputBuffer buf, Endpoint endpoint) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public long getVersion()
public Id getId()
public boolean equals(java.lang.Object peer)
equals
in class java.lang.Object
peer
- DESCRIBE THE PARAMETER
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringFull()
toStringFull
in interface Id
public int compareTo(Id o)
compareTo
in interface java.lang.Comparable<Id>
o
- DESCRIBE THE PARAMETER
public int hashCode()
hashCode
in class java.lang.Object
public byte[] toByteArray()
toByteArray
in interface Id
public void toByteArray(byte[] result, int offset)
toByteArray
in interface Id
public int getByteArrayLength()
getByteArrayLength
in interface Id
public boolean isBetween(Id ccw, Id cw)
Id
isBetween
in interface Id
ccw
- the counterclockwise idcw
- the clockwise id
public Id.Distance longDistanceFromId(Id nid)
Id
longDistanceFromId
in interface Id
nid
- the other node id.
public Id.Distance distanceFromId(Id nid)
Id
distanceFromId
in interface Id
nid
- the other node id.
public Id addToId(Id.Distance offset)
Id
addToId
in interface Id
offset
- the distance to add
public boolean clockwise(Id nid)
Id
clockwise
in interface Id
nid
- The id to compare to
public static VersionKey build(java.lang.String s)
public void serialize(OutputBuffer buf) throws java.io.IOException
Id
serialize
in interface Id
java.io.IOException
public short getType()
getType
in interface Id
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |