Rice Pastry API

rice.p2p.commonapi
Interface IdFactory


public interface IdFactory

Version:
$Id: IdFactory.java,v 1.4 2003/06/11 17:24:48 amislove Exp $
Author:
Alan Mislove, Peter Druschel

Method Summary
 Id buildId(byte[] material)
          Builds a protocol-specific Id given the source data.
 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.
 IdRange buildIdRange(Id cw, Id ccw)
          Creates an IdRange given the CW and CCW ids.
 IdSet buildIdSet()
          Creates an empty IdSet.
 

Method Detail

buildId

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

Parameters:
material - The material to use
Returns:
The built Id.

buildId

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

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.

Parameters:
string - The string to use as source data
Returns:
The built Id.

buildIdRange

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

Parameters:
cw - The clockwise Id
ccw - The counterclockwise Id
Returns:
An IdRange with the appropriate delimiters.

buildIdSet

public IdSet buildIdSet()
Creates an empty IdSet.

Returns:
an empty IdSet

Rice Pastry API

Copyright © 2001 - Rice Pastry