Package com.io7m.jranges
Interface RangeHalfOpenDType
- All Known Implementing Classes:
RangeHalfOpenD
@Immutable
public interface RangeHalfOpenDType
A half open (inclusive lower, exclusive upper) range with
double components.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCheck preconditions for the type.default booleanincludesValue(double value) Determine if the given value is included in this range.default doubleinterval()Retrieve the number of values in the range[lower, upper).default booleanisIncludedIn(RangeHalfOpenD other) Determine if the given range is included in this range.default booleanisIncludedIn(RangeInclusiveD other) Determine if the given range is included in this range.doublelower()doubleupper()
-
Method Details
-
lower
@Parameter double lower()- Returns:
- The lower bound of the inclusive range.
-
upper
@Parameter double upper()- Returns:
- The upper bound of the inclusive range.
-
interval
default double 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(double value) Determine if the given value is included in this range.
- Parameters:
value- The given value- Returns:
trueiffvalue >= this.getLower() && value < this.getUpper().
-
isIncludedIn
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
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.
-