|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.NodeSet
public class NodeSet
Represents an ordered set of NodeHandles. *
| Field Summary | |
|---|---|
static short |
TYPE
|
| Constructor Summary | |
|---|---|
NodeSet()
Constructor. |
|
NodeSet(InputBuffer buf,
NodeHandleFactory nhf)
|
|
NodeSet(NodeSet o)
Copy constructor. |
|
NodeSet(java.util.Vector<NodeHandle> s)
Constructor. |
|
| Method Summary | |
|---|---|
NodeHandle |
get(Id nid)
Finds the NodeHandle associated with a NodeId. |
NodeHandle |
get(int i)
Gets the ith element in the set. |
NodeHandle |
getHandle(Id id)
Finds the NodeHandle associated with the NodeId. |
NodeHandle |
getHandle(int i)
Gets the ith element in the set. |
int |
getIndex(Id nid)
Gets the index of the element with the given node id. |
int |
getIndex(NodeHandle nh)
|
int |
getIndexHandle(Id id)
Gets the index of the element with the given node id. |
java.util.Iterator |
getIterator()
return an iterator that iterates over the elements of this set |
short |
getType()
|
int |
indexOf(NodeHandle handle)
determine rank of a member |
boolean |
insert(int index,
NodeHandle handle)
insert a member at the given index |
java.util.Iterator |
iterator()
|
boolean |
member(NodeHandle handle)
test membership |
boolean |
memberHandle(Id id)
Verifies if the set contains this particular id. |
boolean |
put(NodeHandle handle)
Appends a member to the ordered set. |
boolean |
putHandle(NodeHandle handle)
Puts a NodeHandle into the set. |
void |
randomize(RandomSource random)
Method which randomizes the order of this NodeSet |
NodeHandle |
remove(Id nid)
Removes a node id and its handle from the set. |
void |
remove(int index)
remove a member at a given position |
NodeHandle |
remove(NodeHandle handle)
remove a member |
NodeHandle |
removeHandle(Id id)
Removes a node id and its handle from the set. |
void |
serialize(OutputBuffer buf)
|
int |
size()
Gets the number of elements. |
java.lang.String |
toString()
Returns a string representation of the NodeSet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final short TYPE
| Constructor Detail |
|---|
public NodeSet()
public NodeSet(java.util.Vector<NodeHandle> s)
public NodeSet(NodeSet o)
public NodeSet(InputBuffer buf,
NodeHandleFactory nhf)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public boolean put(NodeHandle handle)
put in interface NodeSetIhandle - the handle to put.
public void randomize(RandomSource random)
public NodeHandle get(Id nid)
get in interface NodeSetInid - a node id.
public NodeHandle get(int i)
get in interface NodeSetIi - an index.
public NodeHandle remove(Id nid)
nid - the node to remove.
public int size()
size in interface NodeHandleSetsize in interface NodeSetIpublic int getIndex(Id nid)
getIndex in interface NodeSetInid - the node id.
public int getIndex(NodeHandle nh)
getIndex in interface NodeSetI
public boolean insert(int index,
NodeHandle handle)
index - the position at which to insert the element into the ordered
sethandle - the handle to add
public NodeHandle remove(NodeHandle handle)
remove in interface NodeSetIhandle - the handle to remove
public void remove(int index)
index - the position of the member to removepublic int indexOf(NodeHandle handle)
handle - the handle to test
public boolean member(NodeHandle handle)
member in interface NodeSetIhandle - the handle to test
public java.util.Iterator getIterator()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean putHandle(NodeHandle handle)
putHandle in interface NodeHandleSethandle - the handle to put.
public NodeHandle getHandle(Id id)
getHandle in interface NodeHandleSetid - a node id.
public NodeHandle getHandle(int i)
getHandle in interface NodeHandleSeti - an index.
public boolean memberHandle(Id id)
memberHandle in interface NodeHandleSetid - a node id.
public NodeHandle removeHandle(Id id)
removeHandle in interface NodeHandleSetnid - the node to remove.
public int getIndexHandle(Id id)
throws java.util.NoSuchElementException
getIndexHandle in interface NodeHandleSetid - the id.
java.util.NoSuchElementExceptionpublic java.util.Iterator iterator()
public void serialize(OutputBuffer buf)
throws java.io.IOException
serialize in interface NodeHandleSetjava.io.IOExceptionpublic short getType()
getType in interface NodeHandleSet
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||