Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 3613 2007-02-15 14:45:14Z jstewart $
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

    int numElements()

  return the number of elements

### addId

    void addId(Id id)

  add a member

  Parameters:
    `id` - the id to add

### removeId

    void removeId(Id id)

  remove a member

  Parameters:
    `id` - the id to remove

### isMemberId

    boolean isMemberId(Id id)

  test membership

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

### subSet

    IdSet subSet(IdRange range)

  return a subset of this set, consisting of the member ids in a given range

  Parameters:
    `from` - the lower end of the range (inclusive)
    `to` - the upper end of the range (exclusive)
  Returns:
    the subset

### getIterator

    java.util.Iterator getIterator()

  return an iterator over the elements of this set

  Returns:
    the interator

### asArray

    Id[] asArray()

  return this set as an array

  Returns:
    the array

### hash

    byte[] hash()

  return a hash of this set

  Returns:
    the hash of this set

### clone

    java.lang.Object clone()

  Override clone() to make it publicly accessible

  Returns:
    A clone of this set

### build

    IdSet build()

  Returns a new, empty IdSet of this type

  Returns:
    A new IdSet

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.