Rice Pastry API

rice.p2p.glacier
Class FragmentKey

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

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

DESCRIBE THE CLASS

Version:
$Id: FragmentKey.java 3274 2006-05-15 16:17: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  int id
          DESCRIBE THE FIELD
protected  VersionKey key
          DESCRIBE THE FIELD
static short TYPE
          DESCRIBE THE FIELD
 
Constructor Summary
FragmentKey(InputBuffer buf, Endpoint endpoint)
          Constructor for FragmentKey.
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()
          Gets the Type attribute of the FragmentKey object
 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)
          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

key

protected VersionKey key
DESCRIBE THE FIELD


id

protected int id
DESCRIBE THE FIELD


TYPE

public static final short TYPE
DESCRIBE THE FIELD

See Also:
Constant Field Values
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
Constructor for FragmentKey.

Parameters:
buf - DESCRIBE THE PARAMETER
endpoint - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION
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

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

getType

public short getType()
Gets the Type attribute of the FragmentKey object

Specified by:
getType in interface Id
Returns:
The Type value

equals

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

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
Parameters:
result - DESCRIBE THE PARAMETER
offset - DESCRIBE THE PARAMETER

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

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

Returns:
DESCRIBE THE RETURN VALUE

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
DESCRIBE THE METHOD

Specified by:
serialize in interface Id
Parameters:
buf - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection