Rice Pastry API

rice.p2p.commonapi
Interface NodeHandleSet

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
NodeSetI
All Known Implementing Classes:
MultiringNodeHandleSet, NodeSet, RouteSet, SimilarSet

public interface NodeHandleSet
extends java.io.Serializable

Version:
$Id: NodeHandleSet.java 2302 2005-03-11 00:58:26Z jeffh $
Author:
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.
 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.
 int size()
          Gets the size of the set.
 

Method Detail

putHandle

public 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

public 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

public 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

public 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

public NodeHandle removeHandle(Id id)
Removes a node id and its handle from the set.

Parameters:
id - DESCRIBE THE PARAMETER
Returns:
the node handle removed or null if nothing.

size

public int size()
Gets the size of the set.

Returns:
the size.

getIndexHandle

public 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 - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection