OrderedSet<T> Class

A mutable ReadonlyOrderedSet.

Extends

Methods

Name Description
constructor<T>(compare: OrderedComparator<T, T>, clone: CloneFunction<T> = shallowClone): OrderedSet<T> Construct a new OrderedSet.  
add(value: T): OrderedSet<T> Add the specified element to the set.  
clear(): void Remove all elements from the set.  
delete(value: T): boolean Removes the specified element from the set.  

Inherited methods

Name Inherited from Description
[iterator](): Iterator<T, any, undefined> ReadonlyOrderedSet<T> Iterate over the elements in sorted order (as opposed to Set's iterator, which returns elements in insertion order).
has(value: T): boolean ReadonlyOrderedSet<T> Returns true if value is present in the set.

Inherited properties

Name Type Inherited from Description
_array ProtectedReadonly SortedArray<T> ReadonlyOrderedSet<T>  
size Accessor ReadOnly number ReadonlyOrderedSet<T> The number of elements in the set.

Defined in

Last Updated: 30 November, 2023