|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.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. |
java.util.Collection<NodeHandle> |
getCollection()
|
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<NodeHandle> |
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<NodeHandle> |
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 NodeSetI
handle
- the handle to put.
public void randomize(RandomSource random)
public NodeHandle get(Id nid)
get
in interface NodeSetI
nid
- a node id.
public NodeHandle get(int i)
get
in interface NodeSetI
i
- an index.
public NodeHandle remove(Id nid)
nid
- the node to remove.
public int size()
size
in interface NodeHandleSet
size
in interface NodeSetI
public int getIndex(Id nid)
getIndex
in interface NodeSetI
nid
- 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 NodeSetI
handle
- 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 NodeSetI
handle
- the handle to test
public java.util.Iterator<NodeHandle> getIterator()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean putHandle(NodeHandle handle)
putHandle
in interface NodeHandleSet
handle
- the handle to put.
public NodeHandle getHandle(Id id)
getHandle
in interface NodeHandleSet
id
- a node id.
public NodeHandle getHandle(int i)
getHandle
in interface NodeHandleSet
i
- an index.
public boolean memberHandle(Id id)
memberHandle
in interface NodeHandleSet
id
- a node id.
public NodeHandle removeHandle(Id id)
removeHandle
in interface NodeHandleSet
nid
- the node to remove.
public int getIndexHandle(Id id) throws java.util.NoSuchElementException
getIndexHandle
in interface NodeHandleSet
id
- the id.
java.util.NoSuchElementException
public java.util.Iterator<NodeHandle> iterator()
public void serialize(OutputBuffer buf) throws java.io.IOException
serialize
in interface NodeHandleSet
java.io.IOException
public short getType()
getType
in interface NodeHandleSet
public java.util.Collection<NodeHandle> getCollection()
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |