Rice Pastry API

rice.p2p.glacier
Class FragmentKey

java.lang.Object
  extended by rice.p2p.glacier.FragmentKey
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Id

public class FragmentKey
extends java.lang.Object
implements Id, java.lang.Comparable

DESCRIBE THE CLASS

Version:
$Id: FragmentKey.java 3524 2007-01-09 14:09:27Z jeffh $
Author:
ahae
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface rice.p2p.commonapi.Id
Id.Distance
 
Field Summary
protected  int id
          DESCRIBE THE FIELD
protected  VersionKey key
          DESCRIBE THE FIELD
static short TYPE
           
 
Constructor Summary
FragmentKey(InputBuffer buf, Endpoint endpoint)
           
FragmentKey(VersionKey key, int id)
          Constructor for FragmentKey.
 
Method Summary
 Id addToId(Id.Distance offset)
          Adds a feature to the ToId attribute of the FragmentKey object
 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
 int getFragmentID()
          Gets the FragmentID attribute of the FragmentKey object
 FragmentKey getPeerKey(int otherId)
          Gets the PeerKey attribute of the FragmentKey object
 short getType()
           
 VersionKey getVersionKey()
          Gets the VersionKey attribute of the FragmentKey object
 int hashCode()
          DESCRIBE THE METHOD
 boolean isBetween(Id ccw, Id cw)
          Gets the Between attribute of the FragmentKey object
 Id.Distance longDistanceFromId(Id nid)
          DESCRIBE THE METHOD
 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

TYPE

public static final short TYPE
See Also:
Constant Field Values

key

protected VersionKey key
DESCRIBE THE FIELD


id

protected int id
DESCRIBE THE FIELD

Constructor Detail

FragmentKey

public FragmentKey(VersionKey key,
                   int id)
Constructor for FragmentKey.

Parameters:
key - DESCRIBE THE PARAMETER
id - DESCRIBE THE PARAMETER

FragmentKey

public FragmentKey(InputBuffer buf,
                   Endpoint endpoint)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

isBetween

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

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

getVersionKey

public VersionKey getVersionKey()
Gets the VersionKey attribute of the FragmentKey object

Returns:
The VersionKey value

getFragmentID

public int getFragmentID()
Gets the FragmentID attribute of the FragmentKey object

Returns:
The FragmentID value

getPeerKey

public FragmentKey getPeerKey(int otherId)
Gets the PeerKey attribute of the FragmentKey object

Parameters:
otherId - DESCRIBE THE PARAMETER
Returns:
The PeerKey value

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
peer - DESCRIBE THE PARAMETER
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

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

toStringFull

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

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

toString

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

Overrides:
toString in class java.lang.Object
Returns:
DESCRIBE THE RETURN VALUE

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 FragmentKey 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

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

Overrides:
hashCode in class java.lang.Object
Returns:
DESCRIBE THE RETURN VALUE

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Description copied from interface: Id
Serialize

Specified by:
serialize in interface Id
Throws:
java.io.IOException

getType

public short getType()
Specified by:
getType in interface Id

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection