-
- All Known Implementing Classes:
RangeHalfOpenL
@Immutable public interface RangeHalfOpenLTypeA half open (inclusive lower, exclusive upper) range withlongcomponents.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcheckPreconditions()Check preconditions for the type.default booleanincludesValue(long value)Determine if the given value is included in this range.default longinterval()Retrieve the number of values in the range[lower, upper).default booleanisIncludedIn(RangeHalfOpenL other)Determine if the given range is included in this range.default booleanisIncludedIn(RangeInclusiveL other)Determine if the given range is included in this range.longlower()longupper()
-
-
-
Method Detail
-
lower
@Parameter long lower()
- Returns:
- The lower bound of the inclusive range.
-
upper
@Parameter long upper()
- Returns:
- The upper bound of the inclusive range.
-
interval
default long interval()
Retrieve the number of values in the range
[lower, upper). That is,(upper - lower).- Returns:
- The number of values in the range
-
includesValue
default boolean includesValue(long 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(RangeHalfOpenL 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().
-
isIncludedIn
default boolean isIncludedIn(RangeInclusiveL 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.
-
-