|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.pastry.IdRange
Represents a contiguous range of Pastry ids. *
Constructor Summary | |
IdRange()
Constructor, constructs an empty IdRange |
|
IdRange(boolean type)
|
|
IdRange(rice.pastry.Id ccw,
rice.pastry.Id cw)
Constructor. |
|
IdRange(rice.pastry.IdRange o)
Copy constructor. |
Method Summary | |
rice.pastry.IdRange |
ccwHalf()
get counterclockwise half of the range |
rice.pastry.IdRange |
complement()
get the complement of this range on the ring |
boolean |
contains(rice.pastry.Id key)
test if a given key lies within this range |
boolean |
containsId(rice.p2p.commonapi.Id key)
test if a given key lies within this range |
rice.pastry.IdRange |
cwHalf()
get clockwise half of the range |
rice.pastry.IdRange |
diff(rice.pastry.IdRange o)
compute the difference between two ranges (exclusive or of keys in the two ranges) two ranges may differ in two ranges on the circle; this method produces one such range of difference if one exists the other range of difference can be computed by invoking o.diff(this) |
boolean |
equals(java.lang.Object obj)
equality operator |
rice.pastry.Id |
getCCW()
get counterclockwise edge of range |
rice.p2p.commonapi.Id |
getCCWId()
get counterclockwise edge of range |
rice.p2p.commonapi.IdRange |
getComplementRange()
get the complement of this range |
rice.pastry.Id |
getCW()
get clockwise edge of range |
rice.p2p.commonapi.Id |
getCWId()
get clockwise edge of range |
rice.pastry.IdRange |
intersect(rice.pastry.IdRange o)
intersect two ranges returns an empty range if the ranges don't intersect two ranges may intersect in two ranges on the circle; this method produces one such range of intersection if one exists the other range of intersection can be computed by invoking o.intersect(this) |
boolean |
isAdjacent(rice.pastry.IdRange o)
test if this range is adjacent to another range |
boolean |
isEmpty()
test if the range is empty |
boolean |
isFull()
test if the range is the full circle |
rice.pastry.IdRange |
merge(rice.pastry.IdRange o)
merge two ranges if this and other don't overlap, are not adjacent, and this is not empty, then the result is this |
rice.pastry.IdRange |
subtract(rice.pastry.IdRange o,
boolean cwPart)
subtract the other range from this computes the ranges of keys that are in this but not in o subtracting a range may produce two ranges on the circle; this method produces one such ranges under control of the cwPart parameter |
java.lang.String |
toString()
Returns a string representation of the range. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IdRange(rice.pastry.Id ccw, rice.pastry.Id cw)
ccw
- the id at the counterclockwise edge of the range (inclusive)cw
- the id at the clockwise edge of the range (exclusive)public IdRange()
public IdRange(boolean type)
public IdRange(rice.pastry.IdRange o)
Method Detail |
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other IdRange
public boolean isEmpty()
public boolean isFull()
public boolean isAdjacent(rice.pastry.IdRange o)
o
- another range
public boolean contains(rice.pastry.Id key)
key
- the key
public rice.pastry.Id getCCW()
public rice.pastry.Id getCW()
public rice.pastry.IdRange merge(rice.pastry.IdRange o)
o
- the other range
public rice.pastry.IdRange complement()
public rice.pastry.IdRange intersect(rice.pastry.IdRange o)
o
- the other range
public rice.pastry.IdRange diff(rice.pastry.IdRange o)
o
- the other range
public rice.pastry.IdRange subtract(rice.pastry.IdRange o, boolean cwPart)
o
- the other rangecwPart
- if true, returns the clockwise part of the range subtraction, else the counterclockwise part
public rice.pastry.IdRange ccwHalf()
public rice.pastry.IdRange cwHalf()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean containsId(rice.p2p.commonapi.Id key)
containsId
in interface IdRange
key
- the key
public rice.p2p.commonapi.Id getCCWId()
getCCWId
in interface IdRange
public rice.p2p.commonapi.Id getCWId()
getCWId
in interface IdRange
public rice.p2p.commonapi.IdRange getComplementRange()
getComplementRange
in interface IdRange
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |