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 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
Methods
Name | Description | |
---|---|---|
constructor(ids?: string): MutableCompressedId64Set | Construct a new set, optionally initialized to contain the Ids represented by ids . |
|
[iterator](): Iterator<string, any, undefined> | Obtain an iterator over the Ids in this set. | |
add(id: string): void | Add the specified Id to the set. | |
clear(): void | Remove all Ids from the set. | |
computeDifference(ids: string | OrderedId64Iterable | MutableCompressedId64Set): string | 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: string | OrderedId64Iterable | MutableCompressedId64Set): string | 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: string | OrderedId64Iterable | MutableCompressedId64Set): string | 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: string): void | Remove the specified Id from the set. | |
equals(other: string | OrderedId64Iterable | MutableCompressedId64Set): boolean | Return true if the set of Ids represented by other is identical to those in this set. |
|
reset(ids?: string): void | Remove all Ids from the set, then add the specified Ids. |
Properties
Name | Type | Description | |
---|---|---|---|
ids Accessor ReadOnly | string | 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: 20 June, 2023