IndexedCollectionInterval<T extends CollectionWithLength> Class
Object describing a (contiguous) subset of indices to an IndexedXYZCollection
Extended by
Methods
Name | Description | |
---|---|---|
constructor<T extends CollectionWithLength>(points: T, base: number, limit: number): IndexedCollectionInterval<T> Protected | ||
advanceBegin(): boolean | Add one to this.begin. | |
advanceEnd(): boolean | advance this.end (but do not go beyond this.points.length) return true if the interval is still live. | |
advanceToHead(other: IndexedCollectionInterval<T>): boolean | Advance this.begin to (other.begin), i.e. | |
advanceToTail(other: IndexedCollectionInterval<T>): boolean | Advance this.begin to (other.end-1), i.e. | |
localIndexToParentIndex(localIndex: number): undefined | number | Return (if possible) the parent index corresponding to localIndex |
|
restrictEnd(): void | restrict this.end to this.points.length | |
setFrom(other: IndexedCollectionInterval<T>, base?: number, limit?: number): void | Set this interval from another, with conditional replacements: | |
createBeginEnd<T extends CollectionWithLength>(points: T, begin: number, end: number): IndexedCollectionInterval<T> Static | Create an interval which matches a collection from start <= i < end . |
|
createBeginLength<T extends CollectionWithLength>(points: T, begin: number, length: number): IndexedCollectionInterval<T> Static | Create an interval which matches a collection from start <= i < end . |
|
createComplete<T extends CollectionWithLength>(points: T): IndexedCollectionInterval<T> Static | Create an interval which matches a complete indexed collection. |
Properties
Name | Type | Description | |
---|---|---|---|
begin | number | lower limit of index range | |
end | number | upper limit (beyond) index range. | |
isNonEmpty Accessor ReadOnly | boolean | Return true if length is 1 or more | |
isSingleton Accessor ReadOnly | boolean | Return true if the length is exactly 1 | |
isValidSubset Accessor ReadOnly | boolean | Return true if | |
length Accessor ReadOnly | number | Return the number of steps possible with current begin and end | |
points | T | Any collection that has a .length member or property |
Defined in
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.