EquatableKeyDictionary
Classes
EquatableKeyDictionary
Represents a dictionary which key supports comparison through equals() method
Type Parameters
| Type Parameter |
|---|
TKey extends IEquatable<TKey> |
TValue |
Constructors
Constructor
new EquatableKeyDictionary<TKey, TValue>(entries?): EquatableKeyDictionary<TKey, TValue>;
Parameters
| Parameter | Type |
|---|---|
entries? | Iterable<[TKey, TValue]> |
Returns
EquatableKeyDictionary<TKey, TValue>
Accessors
size
Get Signature
get size(): number;
Returns
number
Methods
[iterator]()
iterator: IterableIterator<[TKey, TValue]>;
Returns
IterableIterator<[TKey, TValue]>
clear()
clear(): void;
Returns
void
delete()
delete(key): boolean;
Parameters
| Parameter | Type |
|---|---|
key | TKey |
Returns
boolean
entries()
entries(): IterableIterator<[TKey, TValue]>;
Returns
IterableIterator<[TKey, TValue]>
forEach()
forEach(callbackfn, thisArg?): void;
Parameters
| Parameter | Type |
|---|---|
callbackfn | (value, key, map) => void |
thisArg? | any |
Returns
void
get()
get(key): TValue;
Parameters
| Parameter | Type |
|---|---|
key | TKey |
Returns
TValue
has()
has(key): boolean;
Parameters
| Parameter | Type |
|---|---|
key | TKey |
Returns
boolean
hasEqual()
hasEqual(keyValue): boolean;
Indicates whether an element with the key equal to given keyValue exists or not.
Parameters
| Parameter | Type |
|---|---|
keyValue | TKey |
Returns
boolean
keys()
keys(): IterableIterator<TKey>;
Returns
IterableIterator<TKey>
set()
set(key, value): this;
Parameters
| Parameter | Type |
|---|---|
key | TKey |
value | TValue |
Returns
this
tryGetKeyEqualTo()
tryGetKeyEqualTo(keyValue): object;
Tries to find a key in the dictionary that is equal to given keyValue.
Returns:
hasKey - indicates whether such a key was found in the dictionary;
key - contains key that is equal to keyValue or null if such key was not found.
Parameters
| Parameter | Type |
|---|---|
keyValue | TKey |
Returns
object
hasKey
hasKey: boolean;
key?
optional key?: TKey;
tryGetValueOf()
tryGetValueOf(keyValue): object;
Tries to find a value in the dictionary corresponding to the key equal to given keyValue.
Returns:
hasValue - indicates whether the value with such key was found;
value - contains value with the key equal to keyValue or null if such key was not found.
Parameters
| Parameter | Type |
|---|---|
keyValue | TKey |
Returns
object
hasValue
hasValue: boolean;
value
value: TValue;
values()
values(): IterableIterator<TValue>;
Returns
IterableIterator<TValue>
Interfaces
IEquatable
Type Parameters
| Type Parameter |
|---|
T |
Methods
equals()
equals(other): boolean;
Parameters
| Parameter | Type |
|---|---|
other | T |
Returns
boolean