Interval<T extends Comparable<Object?>>.closed constructor

  1. @Possible({RangeError})
Interval<T extends Comparable<Object?>>.closed(
  1. T min,
  2. T max
)

Creates an Interval with the closed lower and upper bounds.

In other words, this interval includes both min and max, i.e. { x | min <= x <= max }.

Contract

Throws a RangeError if min > max.

Implementation

@Possible({RangeError})
Interval.closed(T min, T max): min = (value: min, open: false), max = (value: max, open: false) {
  _precondition('[', min, max, ']');
}