|
ePOST 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. *
Constructor Summary | |
---|---|
NodeSet()
Constructor. |
|
NodeSet(NodeSet o)
Copy constructor. |
|
NodeSet(java.util.Vector s)
Constructor. |
Method Summary | |
---|---|
NodeHandle |
get(int i)
Gets the ith element in the set. |
NodeHandle |
get(NodeId nid)
Finds the NodeHandle associated with a NodeId. |
NodeHandle |
getHandle(Id id)
Finds the NodeHandle associated with the NodeId. |
NodeHandle |
getHandle(int i)
Gets the ith element in the set. |
int |
getIndex(NodeHandle nh)
|
int |
getIndex(NodeId nid)
Gets the index of the element with the given node id. |
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 |
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 |
void |
remove(int index)
remove a member at a given position |
NodeHandle |
remove(NodeHandle handle)
remove a member |
NodeHandle |
remove(NodeId nid)
Removes a node id and its handle from the set. |
NodeHandle |
removeHandle(Id id)
Removes a node id and its handle from the set. |
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 |
Constructor Detail |
---|
public NodeSet()
public NodeSet(java.util.Vector s)
public NodeSet(NodeSet o)
Method Detail |
---|
public boolean put(NodeHandle handle)
put
in interface NodeSetI
handle
- the handle to put.
public void randomize(RandomSource random)
public NodeHandle get(NodeId nid)
get
in interface NodeSetI
nid
- a node id.
public NodeHandle get(int i)
get
in interface NodeSetI
i
- an index.
public NodeHandle remove(NodeId nid)
nid
- the node to remove.
public int size()
size
in interface NodeHandleSet
size
in interface NodeSetI
public int getIndex(NodeId 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 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 iterator()
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |