Interval constructor
Initializes a new instance of the Interval struct.
The interval includes the start instant and excludes the
end instant. The end may equal the start (resulting in an empty interval), but must not be before the start.
Implementation
Interval(Instant? start, Instant? end)
: _start = start ?? IInstant.beforeMinValue,
_end = end ?? IInstant.afterMaxValue {
if (_end < _start) {
throw RangeError(
'The end parameter must be equal to or later than the start parameter');
}
}