Package com.io7m.jranges
Interface RangeHalfOpenBType
- All Known Implementing Classes:
RangeHalfOpenB
@Immutable
public interface RangeHalfOpenBType
A half open (inclusive lower, exclusive upper) range with
BigInteger
components.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Check preconditions for the type.default boolean
includesValue
(BigInteger value) Determine if the given value is included in this range.default BigInteger
interval()
Retrieve the number of values in the range[lower, upper]
.default boolean
isIncludedIn
(RangeHalfOpenB other) Determine if the given range is included in this range.default boolean
isIncludedIn
(RangeInclusiveB other) Determine if the given range is included in this range.lower()
upper()
-
Method Details
-
lower
- Returns:
- The lower bound of the inclusive range.
-
upper
- Returns:
- The upper bound of the inclusive range.
-
interval
Retrieve the number of values in the range
[lower, upper]
. That is,(upper - lower)
.- Returns:
- The number of values in the range
-
includesValue
Determine if the given value is included in this range.
- Parameters:
value
- The given value- Returns:
true
iffvalue >= this.getLower() && value < this.getUpper()
.
-
isIncludedIn
Determine if the given range is included in this range.
- Parameters:
other
- The given range- Returns:
true
iffthis.getLower() >= other.getLower() && this.getUpper() <= other.getUpper()
.
-
isIncludedIn
Determine if the given range is included in this range.
- Parameters:
other
- The given range- Returns:
true
iffthis.getLower() >= other.getLower() && this.getUpper() <= other.getUpper()
.
-
checkPreconditions
@Check default void checkPreconditions()Check preconditions for the type.
-