
Range(loc, len)Creates a new Range.
NoteIf given one argument, then the location is .isValid(documentLength)Is the range valid?
Returns Boolean – whether the range is valid.
.isEmpty()Is the range's length 0? Returns Boolean – whether the range is empty. .max()Returns the end of the range (i.e. location + length) Returns Number – the end of the range. .min()Returns the range's location Returns Number – the location of the range. .lastIndex()Returns the last index in the range ( Returns Number – the last index in the range. .hasIndex(idx)Test whether the range has a given index. If the range is empty (
Returns Boolean – true if the range contains the given index. .containsIndex(idx)Test whether the range has a given index. If the range is empty (
Returns Boolean – true if the range contains the given index. .overlapsWith(rng)Checks if two ranges's indexes overlap. If either range is empty, returns
Returns Boolean – whether the given range is overlaps with this range. .intersectsWith(rng)Checks if two ranges's indexes overlap. Considers empty ranges as if they were of length
Returns Boolean – whether the given range intersects with this range. .containsRange(rng)Checks if all indexes of a given range are contained in this range.
Returns Boolean – whether the given range is contained within this range. .equals(rng)Checks if both ranges are equal (treats any two invalid ranges as equal).
Returns Boolean – whether the given range is equal to this range. .toString()Returns a string in the form of Returns String – a string representation of the range. Range.compare(a, b)Compare first by
Returns Number – 