Class RXBuild.Utils.RangeSet
The RangeSet holds a set of numeric ranges sparsely
Defined in: utils.js.
Constructor Attributes | Constructor Name and Description |
---|---|
RXBuild.Utils.RangeSet(inverted)
Creates a new instance of RangeSet
|
Field Attributes | Field Name and Description |
---|---|
True if ranges contained in this instance are to be excluded
|
|
A sorted array of objects in the form {f: num, t: num} specifying inclusive bounds
|
Method Attributes | Method Name and Description |
---|---|
add(range)
The add method adds the specified range to the current instance.
|
|
has(num)
The has method returns whether the specified number is include in the current rangeset instance
|
|
toString()
The toString method builds a string reprensentation of the current instances ranges
|
Class Detail
RXBuild.Utils.RangeSet(inverted)
Creates a new instance of RangeSet
- Parameters:
- {boolean} inverted
true
if ranges added to this instance are to be considered excluded, otherwisefalse
.
Field Detail
{Boolean}
inverted
True if ranges contained in this instance are to be excluded
{Array}
ranges
A sorted array of objects in the form {f: num, t: num} specifying inclusive bounds
Method Detail
add(range)
The add method adds the specified range to the current instance.
- Parameters:
- {Number|Range} range
- A range (of the form
{f: first_int, t: last_int}
), or a single included number.
{boolean}
has(num)
The has method returns whether the specified number is include in the current rangeset instance
- Parameters:
- {Number} num
- The number to test for
- Returns:
- {boolean}
true
if the number is in the range set (or absent and the inverted property istrue
), otherwisefalse
.
{string}
toString()
The toString method builds a string reprensentation of the current instances ranges
- Returns:
- {string} A string representation of this instance (ex:
"1, 4..6, 7..9"
)