OrderedId64Array Class

A SortedArray of unique Id64Strings sorted in ascending order by the 64-bit unsigned integer values of the Ids.

@see CompressedId64Set for an immutable compact string representation.

Extends

Methods

Name Description
constructor(): OrderedId64Array Construct a new, empty array.  

Inherited methods

Name Inherited from Description
[iterator](): Iterator<string, any, undefined> SortedArray<Id64String> Returns an iterator over the contents of the array in sorted order, suitable for use in for-of loops.
_clear(): void Protected SortedArray<Id64String> Clears the contents of the sorted array.
_extractArray(): string[] Protected SortedArray<Id64String> Extracts the sorted array as a T[] and empties the contents of this ReadonlySortedArray.
_insert(value: string, onInsert?: (value: string) => any): number Protected SortedArray<Id64String> Attempts to insert a new value into the array at a position determined by the ordering.
_remove(value: string): number Protected SortedArray<Id64String> Removes the first occurrence of a value comparing equal to the specified value from the array.
clear(): void SortedArray<Id64String> Clears the contents of the sorted array.
contains(value: string): boolean SortedArray<Id64String> Returns true if this array contains at least one value comparing equal to the specified value.
extractArray(): string[] SortedArray<Id64String> Extracts the sorted array as a T[] and empties the contents of this SortedArray.
findEqual(value: string): undefined | string SortedArray<Id64String> Looks up an element comparing equal to the specified value using binary search.
findEquivalent(criterion: (element: string) => number): undefined | string SortedArray<Id64String> Find an element that compares as equivalent based on some criterion.
forEach(func: (value: string) => void): void SortedArray<Id64String> Apply a function to each element in the array, in sorted order.
get(index: number): undefined | string SortedArray<Id64String> Looks up an element by its index in the array.
indexOf(value: string): number SortedArray<Id64String> Looks up the index of an element comparing equal to the specified value using binary search.
indexOfEquivalent(criterion: (element: string) => number): number SortedArray<Id64String> Find the index of an element that compares as equivalent based on some criterion.
insert(value: string, onInsert?: (value: string) => any): number SortedArray<Id64String> Attempts to insert a new value into the array at a position determined by the ordering.
lowerBound(value: string): { equal: boolean, index: number } Protected SortedArray<Id64String> Computes the position at which the specified value should be inserted to maintain sorted order.
remove(value: string): number SortedArray<Id64String> Removes the first occurrence of a value comparing equal to the specified value from the array.
slice(start?: number, end?: number): SortedArray<string> SortedArray<Id64String> The equivalent of Array.slice.

Properties

Name Type Description
array Accessor ReadOnly undefined The underlying array of Ids.  
ids Accessor ReadOnly OrderedId64Iterable An iterable that iterates over the Ids in sorted order.  

Inherited properties

Name Type Inherited from Description
_array Protected string[] SortedArray<Id64String>  
_clone ProtectedReadonly CloneFunction<string> SortedArray<Id64String>  
_compare ProtectedReadonly OrderedComparator<string> SortedArray<Id64String>  
_duplicatePolicy ProtectedReadonly DuplicatePolicy SortedArray<Id64String>  
isEmpty Accessor ReadOnly boolean SortedArray<Id64String> Returns true if the array contains no elements.
length Accessor ReadOnly number SortedArray<Id64String> The number of elements in the array

Defined in

Last Updated: 20 April, 2024