Rice Pastry API

rice.pastry.commonapi
Class PastryIdFactory

java.lang.Object
  |
  +--rice.pastry.commonapi.PastryIdFactory
All Implemented Interfaces:
IdFactory

public class PastryIdFactory
extends java.lang.Object
implements IdFactory

This class provides applications with a way of genertating pastry Ids.

Version:
$Id: PastryIdFactory.java,v 1.3 2003/09/28 08:17:39 amislove Exp $
Author:
Alan Mislove, Peter Druschel

Constructor Summary
PastryIdFactory()
          Constructor
 
Method Summary
 rice.p2p.commonapi.Id buildId(byte[] material)
          Builds a protocol-specific Id given the source data.
 rice.p2p.commonapi.Id buildId(int[] material)
          Builds a protocol-specific Id given the source data.
 rice.p2p.commonapi.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.
 rice.p2p.commonapi.IdRange buildIdRange(rice.p2p.commonapi.Id cw, rice.p2p.commonapi.Id ccw)
          Creates an IdRange given the CW and CCW ids.
 rice.p2p.commonapi.IdSet buildIdSet()
          Creates an empty IdSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PastryIdFactory

public PastryIdFactory()
Constructor

Method Detail

buildId

public rice.p2p.commonapi.Id buildId(byte[] 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 rice.p2p.commonapi.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 rice.p2p.commonapi.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.

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 rice.p2p.commonapi.IdRange buildIdRange(rice.p2p.commonapi.Id cw,
                                               rice.p2p.commonapi.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.

buildIdSet

public rice.p2p.commonapi.IdSet buildIdSet()
Creates an empty IdSet.

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

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection