Rice Pastry API

rice.p2p.glacier
Class FragmentKeyFactory

java.lang.Object
  extended byrice.p2p.glacier.FragmentKeyFactory
All Implemented Interfaces:
IdFactory

public class FragmentKeyFactory
extends java.lang.Object
implements IdFactory

DESCRIBE THE CLASS

Version:
$Id: FragmentKeyFactory.java 2693 2005-08-05 14:00:47Z jeffh $
Author:
ahae

Constructor Summary
FragmentKeyFactory(MultiringIdFactory factory)
          Constructor for FragmentKeyFactory.
 
Method Summary
 Id buildId(byte[] material)
          DESCRIBE THE METHOD
 Id buildId(int[] material)
          Builds a protocol-specific Id given the source data.
 Id buildId(java.lang.String string)
          Builds a protocol-specific Id by using the hash of the given string as source data.
 Id.Distance buildIdDistance(byte[] material)
          Builds a protocol-specific Id.Distance given the source data.
 Id buildIdFromToString(char[] chars, int offset, int length)
          DESCRIBE THE METHOD
 Id buildIdFromToString(java.lang.String string)
          DESCRIBE THE METHOD
 IdRange buildIdRange(Id cw, Id ccw)
          Creates an IdRange given the CW and CCW ids.
 IdRange buildIdRangeFromPrefix(java.lang.String string)
          Builds an IdRange based on a prefix.
 IdSet buildIdSet()
          Creates an empty IdSet.
 IdSet buildIdSet(java.util.SortedMap map)
          Creates an empty IdSet.
 NodeHandleSet buildNodeHandleSet()
          Creates an empty NodeHandleSet.
 Id buildRandomId(java.util.Random rng)
          Builds a random protocol-specific Id.
 Id buildRandomId(RandomSource rng)
          DESCRIBE THE METHOD
 int getIdToStringLength()
          Gets the IdToStringLength attribute of the FragmentKeyFactory object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentKeyFactory

public FragmentKeyFactory(MultiringIdFactory factory)
Constructor for FragmentKeyFactory.

Parameters:
factory - DESCRIBE THE PARAMETER
Method Detail

getIdToStringLength

public int getIdToStringLength()
Gets the IdToStringLength attribute of the FragmentKeyFactory object

Specified by:
getIdToStringLength in interface IdFactory
Returns:
The IdToStringLength value

buildId

public Id buildId(byte[] material)
DESCRIBE THE METHOD

Specified by:
buildId in interface IdFactory
Parameters:
material - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

buildId

public Id buildId(int[] material)
Builds a protocol-specific Id given the source data.

Specified by:
buildId in interface IdFactory
Parameters:
material - The material to use
Returns:
The built Id.

buildId

public Id buildId(java.lang.String string)
Builds a protocol-specific Id by using the hash of the given string as source data.

Specified by:
buildId in interface IdFactory
Parameters:
string - The string to use as source data
Returns:
The built Id.

buildRandomId

public Id buildRandomId(java.util.Random rng)
Builds a random protocol-specific Id.

Specified by:
buildRandomId in interface IdFactory
Parameters:
rng - A random number generator
Returns:
The built Id.

buildRandomId

public Id buildRandomId(RandomSource rng)
DESCRIBE THE METHOD

Specified by:
buildRandomId in interface IdFactory
Parameters:
rng - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

buildIdFromToString

public Id buildIdFromToString(java.lang.String string)
DESCRIBE THE METHOD

Specified by:
buildIdFromToString in interface IdFactory
Parameters:
string - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

buildIdFromToString

public Id buildIdFromToString(char[] chars,
                              int offset,
                              int length)
DESCRIBE THE METHOD

Specified by:
buildIdFromToString in interface IdFactory
Parameters:
chars - DESCRIBE THE PARAMETER
offset - DESCRIBE THE PARAMETER
length - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

buildIdDistance

public Id.Distance buildIdDistance(byte[] material)
Builds a protocol-specific Id.Distance given the source data.

Specified by:
buildIdDistance in interface IdFactory
Parameters:
material - The material to use
Returns:
The built Id.Distance.

buildIdRange

public IdRange buildIdRange(Id cw,
                            Id ccw)
Creates an IdRange given the CW and CCW ids.

Specified by:
buildIdRange in interface IdFactory
Parameters:
cw - The clockwise Id
ccw - The counterclockwise Id
Returns:
An IdRange with the appropriate delimiters.

buildIdRangeFromPrefix

public IdRange buildIdRangeFromPrefix(java.lang.String string)
Builds an IdRange based on a prefix. Any id which has this prefix should be inside this IdRange, and any id which does not share this prefix should be outside it.

Specified by:
buildIdRangeFromPrefix in interface IdFactory
Parameters:
string - The toString() representation of an Id
Returns:
The built Id.

buildIdSet

public IdSet buildIdSet()
Creates an empty IdSet.

Specified by:
buildIdSet in interface IdFactory
Returns:
an empty IdSet

buildIdSet

public IdSet buildIdSet(java.util.SortedMap map)
Creates an empty IdSet.

Specified by:
buildIdSet in interface IdFactory
Parameters:
map - DESCRIBE THE PARAMETER
Returns:
an empty IdSet

buildNodeHandleSet

public NodeHandleSet buildNodeHandleSet()
Creates an empty NodeHandleSet.

Specified by:
buildNodeHandleSet in interface IdFactory
Returns:
an empty NodeHandleSet

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection