Package com.qfs.util
Class IRangeUnion.Range
java.lang.Object
com.qfs.util.IRangeUnion.Range
- Direct Known Subclasses:
MultiVersionDistributedAxisMember.DistributedRange
- Enclosing interface:
- IRangeUnion
Definition of a range [a, b], with both ends a and b included in the range.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontain(long x) booleanlongfrom()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.reverse()Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.toandtovalue is equal tothis.from.longto()Gets the defined "to" bound (inclusive).toString()translate(int dv) Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.from + dvandtovalue is equal tothis.to + dv.
-
Field Details
-
from
public final long fromBeginning of the range (inclusive). -
to
public final long toEnd of the range (inclusive).
-
-
Constructor Details
-
Range
public Range(long from, long to) Constructor.- Parameters:
from- beginning of the range (inclusive)to- end of the range (inclusive)
-
-
Method Details
-
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
Create a newIRangeUnion.Rangewhichfromvalue is equal tothis.toandtovalue is equal tothis.from.- Returns:
- the new reversed
IRangeUnion.Range
-
translate
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
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
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
-
toString
-
hashCode
public int hashCode() -
contain
public boolean contain(long x) -
equals
-