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