Rice Pastry API

rice.p2p.commonapi
Interface NodeHandleSet

All Known Subinterfaces:
NodeSetI
All Known Implementing Classes:
NodeSet, RouteSet, SimilarSet

public interface NodeHandleSet

Version:
$Id: NodeHandleSet.java,v 1.3 2003/06/11 17:24:48 amislove Exp $
Author:
Alan Mislove

Method Summary
 rice.p2p.commonapi.NodeHandle getHandle(rice.p2p.commonapi.Id id)
          Finds the NodeHandle associated with the NodeId.
 rice.p2p.commonapi.NodeHandle getHandle(int i)
          Gets the ith element in the set.
 int getIndexHandle(rice.p2p.commonapi.Id id)
          Gets the index of the element with the given node id.
 boolean memberHandle(rice.p2p.commonapi.Id id)
          Verifies if the set contains this particular id.
 boolean putHandle(rice.p2p.commonapi.NodeHandle handle)
          Puts a NodeHandle into the set.
 rice.p2p.commonapi.NodeHandle removeHandle(rice.p2p.commonapi.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(rice.p2p.commonapi.NodeHandle handle)
Puts a NodeHandle into the set.

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

getHandle

public rice.p2p.commonapi.NodeHandle getHandle(rice.p2p.commonapi.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 rice.p2p.commonapi.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(rice.p2p.commonapi.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 rice.p2p.commonapi.NodeHandle removeHandle(rice.p2p.commonapi.Id id)
Removes a node id and its handle from the set.

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(rice.p2p.commonapi.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.
java.util.NoSuchElementException

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection