Rice Pastry API

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 3274 2006-05-15 16:17:47Z jeffh $
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()
          Gets the Type attribute of the NodeHandleSet object
 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)
          DESCRIBE THE METHOD
 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

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
DESCRIBE THE METHOD

Parameters:
buf - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

getType

public short getType()
Gets the Type attribute of the NodeHandleSet object

Returns:
The Type value

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection