HashSet Class
Package: @esfx/collections-hashset
Declaration
export declare class HashSet<T> implements Collection<T>
Constructors
constructor(equaler)
Constructs a new instance of the HashSet
class
Declaration
constructor(equaler?: Equaler<T>);
Parameters
- equaler
- Equaler<T>
constructor(iterable, equaler)
Constructs a new instance of the HashSet
class
Declaration
constructor(iterable?: Iterable<T>, equaler?: Equaler<T>);
Parameters
- iterable
- Iterable<T>
- equaler
- Equaler<T>
constructor(capacity, equaler)
Constructs a new instance of the HashSet
class
Declaration
constructor(capacity: number, equaler?: Equaler<T>);
Parameters
- capacity
- number
- equaler
- Equaler<T>
Properties
[Collection.size]
Declaration
get [Collection.size](): number;
Property Value
[Symbol.toStringTag]
Declaration
[Symbol.toStringTag]: string;
Property Value
equaler
Declaration
get equaler(): Equaler<T>;
Property Value
Equaler<T>
size
Declaration
get size(): number;
Property Value
Methods
[Collection.add](value)
Declaration
[Collection.add](value: T): void;
Parameters
- value
- T
Returns
void
[Collection.clear]()
Declaration
[Collection.clear](): void;
Returns
void
[Collection.delete](value)
Declaration
[Collection.delete](value: T): boolean;
Parameters
- value
- T
Returns
[Collection.has](value)
Declaration
[Collection.has](value: T): boolean;
Parameters
- value
- T
Returns
[Symbol.iterator]()
Declaration
[Symbol.iterator](): Generator<T, void, unknown>;
Returns
Generator<T, void, unknown>
add(value)
Declaration
add(value: T): this;
Parameters
- value
- T
Returns
this
clear()
Declaration
clear(): void;
Returns
void
delete(value)
Declaration
delete(value: T): boolean;
Parameters
- value
- T
Returns
ensureCapacity(capacity)
Declaration
ensureCapacity(capacity: number): number;
Parameters
- capacity
- number
Returns
entries()
Declaration
entries(): Generator<[T, T], void, unknown>;
Returns
Generator<[T, T], void, unknown>
forEach(callback, thisArg)
Declaration
forEach(callback: (value: T, key: T, map: this) => void, thisArg?: any): void;
Parameters
- callback
- (value: T, key: T, map: this) => void
- thisArg
- any
Returns
void
has(value)
Declaration
has(value: T): boolean;
Parameters
- value
- T
Returns
keys()
Declaration
keys(): Generator<T, void, unknown>;
Returns
Generator<T, void, unknown>
trimExcess(capacity)
Declaration
trimExcess(capacity?: number): void;
Parameters
- capacity
- number
Returns
void
tryAdd(value)
Declaration
tryAdd(value: T): boolean;
Parameters
- value
- T
Returns
values()
Declaration
values(): Generator<T, void, unknown>;
Returns
Generator<T, void, unknown>