Rice Pastry API

rice.p2p.multiring
Class MultiringIdSet

java.lang.Object
  extended byrice.p2p.multiring.MultiringIdSet
All Implemented Interfaces:
IdSet, java.io.Serializable

public class MultiringIdSet
extends java.lang.Object
implements IdSet

Version:
$Id: MultiringIdSet.java,v 1.10 2005/03/11 00:58:01 jeffh Exp $
Author:
Alan Mislove, Peter Druschel
See Also:
Serialized Form

Field Summary
protected  Id ringId
          The ringId of the ids in the set
protected  IdSet set
          The actual IdSet
 
Constructor Summary
protected MultiringIdSet(Id ringId, IdSet set)
          Constructor
 
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()
          Clones this object
 boolean equals(java.lang.Object o)
          Determines equality
 java.util.Iterator getIterator()
          return an iterator over the elements of this set
protected  IdSet getSet()
          Returns the internal set
 byte[] hash()
          return a hash of this set
 int hashCode()
          Returns the hashCode
 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
 java.lang.String toString()
          Prints out the string
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

set

protected IdSet set
The actual IdSet


ringId

protected Id ringId
The ringId of the ids in the set

Constructor Detail

MultiringIdSet

protected MultiringIdSet(Id ringId,
                         IdSet set)
Constructor

Parameters:
ringId - DESCRIBE THE PARAMETER
set - DESCRIBE THE PARAMETER
Method Detail

getSet

protected IdSet getSet()
Returns the internal set

Returns:
The internal set

isMemberId

public boolean isMemberId(Id id)
test membership

Specified by:
isMemberId in interface IdSet
Parameters:
id - the id to test
Returns:
true of id is a member, false otherwise

getIterator

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

Specified by:
getIterator in interface IdSet
Returns:
the interator

numElements

public int numElements()
return the number of elements

Specified by:
numElements in interface IdSet
Returns:
DESCRIBE THE RETURN VALUE

addId

public void addId(Id id)
add a member

Specified by:
addId in interface IdSet
Parameters:
id - the id to add

removeId

public void removeId(Id id)
remove a member

Specified by:
removeId in interface IdSet
Parameters:
id - the id to remove

subSet

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

Specified by:
subSet in interface IdSet
Parameters:
range - DESCRIBE THE PARAMETER
Returns:
the subset

asArray

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

Specified by:
asArray in interface IdSet
Returns:
the array

hash

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

Specified by:
hash in interface IdSet
Returns:
the hash of this set

equals

public boolean equals(java.lang.Object o)
Determines equality

Parameters:
o - DESCRIBE THE PARAMETER
Returns:
Equals

hashCode

public int hashCode()
Returns the hashCode

Returns:
hashCode

toString

public java.lang.String toString()
Prints out the string

Returns:
A string

clone

public java.lang.Object clone()
Clones this object

Specified by:
clone in interface IdSet
Returns:
a clone

build

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

Specified by:
build in interface IdSet
Returns:
A new IdSet

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection