Interface RangeInclusiveDType

All Known Implementing Classes:
RangeInclusiveD

@Immutable public interface RangeInclusiveDType
An inclusive range with double components.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Check preconditions for the type.
    default boolean
    includesValue(double value)
    Determine if the given value is included in this range.
    default double
    Retrieve the number of values in the range [lower, upper].
    default boolean
    Determine if the given range is included in this range.
    double
     
    double
     
  • 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) + 1.

      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:
      true iff value >= this.getLower() && value <= this.getUpper() .
    • isIncludedIn

      default boolean isIncludedIn(RangeInclusiveD other)

      Determine if the given range is included in this range.

      Parameters:
      other - The given range
      Returns:
      true iff this.getLower() >= other.getLower() && this.getUpper() <= other.getUpper() .
    • checkPreconditions

      @Check default void checkPreconditions()
      Check preconditions for the type.