Rice Pastry API

rice.p2p.glacier
Class VersionKey

java.lang.Object
  extended byrice.p2p.glacier.VersionKey
All Implemented Interfaces:
java.lang.Comparable, Id, java.io.Serializable

public class VersionKey
extends java.lang.Object
implements Id, java.io.Serializable, java.lang.Comparable

DESCRIBE THE CLASS

Version:
$Id: VersionKey.java 2693 2005-08-05 14:00:47Z jeffh $
Author:
ahae
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class rice.p2p.commonapi.Id
Id.Distance
 
Field Summary
protected  Id id
          DESCRIBE THE FIELD
protected  long version
          DESCRIBE THE FIELD
 
Constructor Summary
VersionKey(Id id, long version)
          Constructor for VersionKey.
 
Method Summary
 Id addToId(Id.Distance offset)
          Adds a feature to the ToId attribute of the VersionKey object
static VersionKey build(java.lang.String s)
          DESCRIBE THE METHOD
 boolean clockwise(Id nid)
          DESCRIBE THE METHOD
 int compareTo(java.lang.Object o)
          DESCRIBE THE METHOD
 Id.Distance distanceFromId(Id nid)
          DESCRIBE THE METHOD
 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
 long getVersion()
          Gets the Version attribute of the VersionKey object
 int hashCode()
          DESCRIBE THE METHOD
 boolean isBetween(Id ccw, Id cw)
          Gets the Between attribute of the VersionKey object
 Id.Distance longDistanceFromId(Id nid)
          DESCRIBE THE METHOD
 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

id

protected Id id
DESCRIBE THE FIELD


version

protected long version
DESCRIBE THE FIELD

Constructor Detail

VersionKey

public VersionKey(Id id,
                  long version)
Constructor for VersionKey.

Parameters:
id - DESCRIBE THE PARAMETER
version - DESCRIBE THE PARAMETER
Method Detail

getVersion

public long getVersion()
Gets the Version attribute of the VersionKey object

Returns:
The Version value

getId

public Id getId()
Gets the Id attribute of the VersionKey object

Returns:
The Id value

getByteArrayLength

public int getByteArrayLength()
Returns the length of the byte[] representing this Id

Specified by:
getByteArrayLength in interface Id
Returns:
The length of the byte[] representing this Id

isBetween

public boolean isBetween(Id ccw,
                         Id cw)
Gets the Between attribute of the VersionKey object

Specified by:
isBetween in interface Id
Parameters:
ccw - DESCRIBE THE PARAMETER
cw - DESCRIBE THE PARAMETER
Returns:
The Between value

equals

public boolean equals(java.lang.Object peer)
DESCRIBE THE METHOD

Parameters:
peer - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

toString

public java.lang.String toString()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

toStringFull

public java.lang.String toStringFull()
DESCRIBE THE METHOD

Specified by:
toStringFull in interface Id
Returns:
DESCRIBE THE RETURN VALUE

compareTo

public int compareTo(java.lang.Object o)
DESCRIBE THE METHOD

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

hashCode

public int hashCode()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

toByteArray

public byte[] toByteArray()
DESCRIBE THE METHOD

Specified by:
toByteArray in interface Id
Returns:
DESCRIBE THE RETURN VALUE

toByteArray

public void toByteArray(byte[] result,
                        int offset)
Stores the byte[] value of this Id in the provided byte array

Specified by:
toByteArray in interface Id
Parameters:
result - DESCRIBE THE PARAMETER
offset - DESCRIBE THE PARAMETER

longDistanceFromId

public Id.Distance longDistanceFromId(Id nid)
DESCRIBE THE METHOD

Specified by:
longDistanceFromId in interface Id
Parameters:
nid - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

distanceFromId

public Id.Distance distanceFromId(Id nid)
DESCRIBE THE METHOD

Specified by:
distanceFromId in interface Id
Parameters:
nid - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

addToId

public Id addToId(Id.Distance offset)
Adds a feature to the ToId attribute of the VersionKey object

Specified by:
addToId in interface Id
Parameters:
offset - The feature to be added to the ToId attribute
Returns:
DESCRIBE THE RETURN VALUE

clockwise

public boolean clockwise(Id nid)
DESCRIBE THE METHOD

Specified by:
clockwise in interface Id
Parameters:
nid - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

build

public static VersionKey build(java.lang.String s)
DESCRIBE THE METHOD

Parameters:
s - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection