ePOST 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

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

ePOST API

Copyright © 2001-2005 - Rice Pastry.