Package com.qfs.util
Class IRangeUnion.Range
- java.lang.Object
-
- com.qfs.util.IRangeUnion.Range
-
- Direct Known Subclasses:
MultiVersionDistributedAxisMember.DistributedRange
- Enclosing interface:
- IRangeUnion
public static class IRangeUnion.Range extends Object
Definition of a range [a, b], with both ends a and b included in the range.
-
-
Constructor Summary
Constructors Constructor Description Range(long from, long to)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontain(long x)booleanequals(Object obj)longfrom()Gets the defined "from" bound (inclusive).inthashCode()booleanisDisjoint(IRangeUnion.Range other)Test if this range is of intersection null with another range.booleanisIncludedIn(IRangeUnion.Range other)Test if this range is included into another range.IRangeUnion.Rangereverse()Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.toandtovalue is equal tothis.from.longto()Gets the defined "to" bound (inclusive).StringtoString()IRangeUnion.Rangetranslate(int dv)Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.from + dvandtovalue is equal tothis.to + dv.
-
-
-
Method Detail
-
from
public long from()
Gets the defined "from" bound (inclusive).- Returns:
- the lower bound
-
to
public long to()
Gets the defined "to" bound (inclusive).- Returns:
- the upper bound
-
reverse
public IRangeUnion.Range reverse()
Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.toandtovalue is equal tothis.from.- Returns:
- the new reversed
IRangeUnion.Range
-
translate
public IRangeUnion.Range translate(int dv)
Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.from + dvandtovalue is equal tothis.to + dv.- Parameters:
dv- the translation amount- Returns:
- the new translated
IRangeUnion.Range
-
isIncludedIn
public boolean isIncludedIn(IRangeUnion.Range other)
Test if this range is included into another range. Expects from to be lower than to on this range and the other range.- Parameters:
other- the other range that might include this range.- Returns:
- true if this range is included in the other range.
-
isDisjoint
public boolean isDisjoint(IRangeUnion.Range other)
Test if this range is of intersection null with another range.- Parameters:
other- other range to compare to this- Returns:
- true if the range are disjoint, false otherwise
-
contain
public boolean contain(long x)
-
-