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 NodeHandleSet

All Superinterfaces:
  java.io.Serializable

All Known Subinterfaces:
  NodeSetI

All Known Implementing Classes:
  MultiringNodeHandleSet, NodeSet, RouteSet

    public interface NodeHandleSet

extends java.io.Serializable

Version:
  $Id: NodeHandleSet.java 3613 2007-02-15 14:45:14Z jstewart $
Author:
  Jeff Hoye, Alan Mislove

Method Summary
`NodeHandle` | `getHandle(Id id)` Finds the NodeHandle associated with the NodeId.
`NodeHandle` | `getHandle(int i)` Gets the ith element in the set.
`int` | `getIndexHandle(Id id)` Gets the index of the element with the given node id.
`short` | `getType()`
`boolean` | `memberHandle(Id id)` Verifies if the set contains this particular id.
`boolean` | `putHandle(NodeHandle handle)` Puts a NodeHandle into the set.
`NodeHandle` | `removeHandle(Id id)` Removes a node id and its handle from the set.
`void` | `serialize(OutputBuffer buf)`
`int` | `size()` Gets the size of the set.

Method Detail

### putHandle

    boolean putHandle(NodeHandle handle)

  Puts a NodeHandle into the set.

  Parameters:
    `handle` - the handle to put.
  Returns:
    true if the put succeeded, false otherwise.

### getHandle

    NodeHandle getHandle(Id id)

  Finds the NodeHandle associated with the NodeId.

  Parameters:
    `id` - a node id.
  Returns:
    the handle associated with that id or null if no such handle is found.

### getHandle

    NodeHandle getHandle(int i)

  Gets the ith element in the set.

  Parameters:
    `i` - an index.
  Returns:
    the handle associated with that id or null if no such handle is found.

### memberHandle

    boolean memberHandle(Id id)

  Verifies if the set contains this particular id.

  Parameters:
    `id` - a node id.
  Returns:
    true if that node id is in the set, false otherwise.

### removeHandle

    NodeHandle removeHandle(Id id)

  Removes a node id and its handle from the set.

  Parameters:
    `nid` - the node to remove.
  Returns:
    the node handle removed or null if nothing.

### size

    int size()

  Gets the size of the set.

  Returns:
    the size.

### getIndexHandle

    int getIndexHandle(Id id)
                       throws java.util.NoSuchElementException

  Gets the index of the element with the given node id.

  Parameters:
    `id` - the id.
  Returns:
    the index or throws a NoSuchElementException.
  Throws:
    `java.util.NoSuchElementException`

### serialize

    void serialize(OutputBuffer buf)
                   throws java.io.IOException

  Throws:
    `java.io.IOException`

### getType

    short getType()

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.