|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.IdRange
public class IdRange
Represents a contiguous range of Pastry ids. *
Constructor Summary | |
---|---|
IdRange()
Constructor, constructs an empty IdRange |
|
IdRange(boolean type)
|
|
IdRange(Id ccw,
Id cw)
Constructor. |
|
IdRange(IdRange o)
Copy constructor. |
Method Summary | |
---|---|
IdRange |
ccwHalf()
get counterclockwise half of the range |
IdRange |
complement()
get the complement of this range on the ring |
boolean |
contains(Id key)
test if a given key lies within this range |
boolean |
containsId(Id key)
test if a given key lies within this range |
IdRange |
cwHalf()
get clockwise half of the range |
IdRange |
diff(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) |
IdRange |
diffRange(IdRange range)
diffs the given range with this range |
boolean |
equals(java.lang.Object obj)
equality operator |
Id |
getCCW()
get counterclockwise edge of range |
Id |
getCCWId()
get counterclockwise edge of range |
IdRange |
getComplementRange()
get the complement of this range |
Id |
getCW()
get clockwise edge of range |
Id |
getCWId()
get clockwise edge of range |
IdRange |
intersect(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) |
IdRange |
intersectRange(IdRange range)
intersects the given range with this range |
boolean |
isAdjacent(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 |
IdRange |
merge(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 |
IdRange |
mergeRange(IdRange range)
merges the given range with this range |
IdRange |
subtract(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(Id ccw, 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(IdRange o)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other IdRange
public boolean isEmpty()
isEmpty
in interface IdRange
public boolean isFull()
public boolean isAdjacent(IdRange o)
o
- another range
public boolean contains(Id key)
key
- the key
public Id getCCW()
public Id getCW()
public IdRange merge(IdRange o)
o
- the other range
public IdRange complement()
public IdRange intersect(IdRange o)
o
- the other range
public IdRange diff(IdRange o)
o
- the other range
public IdRange subtract(IdRange o, boolean cwPart)
o
- the other rangecwPart
- if true, returns the clockwise part of the range subtraction,
else the counterclockwise part
public IdRange ccwHalf()
public IdRange cwHalf()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean containsId(Id key)
containsId
in interface IdRange
key
- the key
public Id getCCWId()
getCCWId
in interface IdRange
public Id getCWId()
getCWId
in interface IdRange
public IdRange getComplementRange()
getComplementRange
in interface IdRange
public IdRange mergeRange(IdRange range)
mergeRange
in interface IdRange
public IdRange diffRange(IdRange range)
diffRange
in interface IdRange
public IdRange intersectRange(IdRange range)
intersectRange
in interface IdRange
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |