Private
#maxPrivate
#minTest if this range represents a singleton value, where the minimum and maximum values in the range are equal.
Get the number of values between min
and max
, inclusive.
This will return +Inf
if either min
or max
is null
.
Get the minimum value.
Get the minimum value.
Private
#compareTest if this range is adjacent to (but not intersecting) a given range.
the range to compare to this range
true
if this range is adjacent to the given range
Test if this range could be merged with another range.
Two ranges can be merged if they are either adjacent to or intersect with each other.
the range to test
true
if this range is either adjacent to or intersects with the given range
Compares this object with the specified object for order.
Unbounded (null
) values are ordered before bounded (non-null
) values.
the range to compare to
-1
, 0
, or 1
if this is less than, equal to, or greater than o
Test if another range is completely within this range, inclusive.
the range to test
true
if this.min <= o.min <= o.max <= this.max
Test if this range intersects with a given range.
the range to compare to this range
true
if this range intersects (overlaps) with the given range
Static
delimiterStatic
descriptionGenerate a description of a range.
the "full" range that defines the bounds of r
Optional
r: IntRangethe range
Optional
options: IntRangeFormatOptionsoptions to control formatting
if r
represents "all possible values" then the literal string *
,
otherwise the string representation of r
This method is similar to toString(), except that it compares a given range
with a bounding range. If the given range is equal to the bounding range, or the given range
is undefined, then the given range is taken to mean "all possible values" and a *
character
is returned instead of the normal [min..max]
representation.
Static
ofStatic
parseParse a range array of number strings into an IntRange
.
the range to parse; can be a string adhering to splitRange()
or an array with 1 or 2 number value elements, or *
to represent "none"
Optional
bounds: IntRangethe optional bounds (inclusive) to enforce; if the parsed range
Optional
options: IntRangeFormatOptionsoptions to control the formatting
the parsed range, or undefined
if a range could not be parsed or extends
beyond the given bounds
then undefined
will be returned
Static
rangeGenerated using TypeDoc
An immutable number range with min/max values.
Remarks
The minimum and maximum values can use
null
to represent "none".