MutableCompressedId64Set Class

A mutable set of valid Id64Strings sorted in ascending order by the 64-bit unsigned integer value of the Ids. Internally the set of Ids is maintained as a MutableCompressedId64Set.CompressedId64Set string representation. Insertions and removals are buffered until the string representation needs to be recomputed. The string representation is recomputed by every public method except MutableCompressedId64Set.add and MutableCompressedId64Set.delete - therefore, if multiple removals and/or insertions are required, it is most efficient to perform them all before invoking other methods.

Implements

  • Iterable

Methods

Name Description
constructor(ids?: CompressedId64Set): MutableCompressedId64Set Construct a new set, optionally initialized to contain the Ids represented by ids.  
[Symbol.iterator](): Iterator<string, any, undefined> Obtain an iterator over the Ids in this set.  
add(id: Id64String): void Add the specified Id to the set.  
clear(): void Remove all Ids from the set.  
computeDifference(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set Compute a compact string representation of the difference between this and another set - i.e., those Ids present in this but not in the other set.  
computeIntersection(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set Compute a compact string representation of the intersection of this and another set of Ids - i.e., those Ids present in both this and the other set.  
computeUnion(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set Compute a compact string representation of the union of this and another set of Ids - i.e., those Ids present in either this and/or the other set.  
delete(id: Id64String): void Remove the specified Id from the set.  
equals(other: CompressedId64Set | MutableCompressedId64Set | OrderedId64Iterable): boolean Return true if the set of Ids represented by other is identical to those in this set.  
reset(ids?: CompressedId64Set): void Remove all Ids from the set, then add the specified Ids.  

Properties

Name Type Description
ids Accessor ReadOnly CompressedId64Set Obtain the compact string representation of the contents of this set.  
isEmpty Accessor ReadOnly boolean Return true if this set contains no Ids.  

Defined in

Last Updated: 31 March, 2021