-
- All Known Implementing Classes:
RangeInclusiveB
@Immutable public interface RangeInclusiveBTypeAn inclusive range withBigIntegercomponents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcheckPreconditions()Check preconditions for the type.default booleanincludesValue(java.math.BigInteger value)Determine if the given value is included in this range.default java.math.BigIntegerinterval()Retrieve the number of values in the range[lower, upper].default booleanisIncludedIn(RangeInclusiveB other)Determine if the given range is included in this range.java.math.BigIntegerlower()java.math.BigIntegerupper()
-
-
-
Method Detail
-
lower
@Parameter java.math.BigInteger lower()
- Returns:
- The lower bound of the inclusive range.
-
upper
@Parameter java.math.BigInteger upper()
- Returns:
- The upper bound of the inclusive range.
-
interval
default java.math.BigInteger interval()
Retrieve the number of values in the range
[lower, upper]. That is,(upper - lower) + 1.- Returns:
- The number of values in the range
-
includesValue
default boolean includesValue(java.math.BigInteger value)
Determine if the given value is included in this range.
- Parameters:
value- The given value- Returns:
trueiffvalue >= this.getLower() && value <= this.getUpper().
-
isIncludedIn
default boolean isIncludedIn(RangeInclusiveB other)
Determine if the given range is included in this range.
- Parameters:
other- The given range- Returns:
trueiffthis.getLower() >= other.getLower() && this.getUpper() <= other.getUpper().
-
checkPreconditions
@Check default void checkPreconditions()
Check preconditions for the type.
-
-