Rice Pastry API

rice.p2p.commonapi
Interface IdSet

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FragmentKeySet, GCIdSet, IdSet, MultiringIdSet, VersionKeySet

public interface IdSet
extends java.io.Serializable

Version:
$Id: IdSet.java 2302 2005-03-11 00:58:26Z jeffh $
Author:
Alan Mislove, Peter Druschel

Method Summary
 void addId(Id id)
          add a member
 Id[] asArray()
          return this set as an array
 IdSet build()
          Returns a new, empty IdSet of this type
 java.lang.Object clone()
          Override clone() to make it publicly accessible
 java.util.Iterator getIterator()
          return an iterator over the elements of this set
 byte[] hash()
          return a hash of this set
 boolean isMemberId(Id id)
          test membership
 int numElements()
          return the number of elements
 void removeId(Id id)
          remove a member
 IdSet subSet(IdRange range)
          return a subset of this set, consisting of the member ids in a given range
 

Method Detail

numElements

public int numElements()
return the number of elements

Returns:
DESCRIBE THE RETURN VALUE

addId

public void addId(Id id)
add a member

Parameters:
id - the id to add

removeId

public void removeId(Id id)
remove a member

Parameters:
id - the id to remove

isMemberId

public boolean isMemberId(Id id)
test membership

Parameters:
id - the id to test
Returns:
true of id is a member, false otherwise

subSet

public IdSet subSet(IdRange range)
return a subset of this set, consisting of the member ids in a given range

Parameters:
range - DESCRIBE THE PARAMETER
Returns:
the subset

getIterator

public java.util.Iterator getIterator()
return an iterator over the elements of this set

Returns:
the interator

asArray

public Id[] asArray()
return this set as an array

Returns:
the array

hash

public byte[] hash()
return a hash of this set

Returns:
the hash of this set

clone

public java.lang.Object clone()
Override clone() to make it publicly accessible

Returns:
A clone of this set

build

public IdSet build()
Returns a new, empty IdSet of this type

Returns:
A new IdSet

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection