Back to Website
Show / Hide Table of Contents

Class EquatableKeyDictionary

Represents a dictionary which key supports comparison through equals() method

Package: @aurigma/design-atoms-model

Constructors

(constructor)(entries)

Constructs a new instance of the EquatableKeyDictionary class

Declaration
constructor(entries?: Iterable<[TKey, TValue]>);
Parameters
Type Name Description
Iterable<[TKey, TValue]> entries

Properties

size

Declaration
get size(): number;
Property Value
Type Description
number

Methods

[Symbol.iterator]()

Declaration
[Symbol.iterator](): IterableIterator<[TKey, TValue]>;
Returns
Type Description
IterableIterator<[TKey, TValue]>

clear()

Declaration
clear(): void;
Returns
Type Description
void

delete(key)

Declaration
delete(key: TKey): boolean;
Parameters
Type Name Description
TKey key
Returns
Type Description
boolean

entries()

Declaration
entries(): IterableIterator<[TKey, TValue]>;
Returns
Type Description
IterableIterator<[TKey, TValue]>

forEach(callbackfn, thisArg)

Declaration
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: any): void;
Parameters
Type Name Description
(value: TValue, key: TKey, map: Map<TKey, TValue>) => void callbackfn
any thisArg
Returns
Type Description
void

get(key)

Declaration
get(key: TKey): TValue;
Parameters
Type Name Description
TKey key
Returns
Type Description
TValue

has(key)

Declaration
has(key: TKey): boolean;
Parameters
Type Name Description
TKey key
Returns
Type Description
boolean

hasEqual(keyValue)

Indicates whether an element with the key equal to given exists or not.

Declaration
hasEqual(keyValue: TKey): boolean;
Parameters
Type Name Description
TKey keyValue
Returns
Type Description
boolean

keys()

Declaration
keys(): IterableIterator<TKey>;
Returns
Type Description
IterableIterator<TKey>

set(key, value)

Declaration
set(key: TKey, value: TValue): this;
Parameters
Type Name Description
TKey key
TValue value
Returns
Type Description
this

tryGetKeyEqualTo(keyValue)

Tries to find a key in the dictionary that is equal to given .

Returns:

hasKey - indicates whether such a key was found in the dictionary;

key - contains key that is equal to or null if such key was not found.

Declaration
tryGetKeyEqualTo(keyValue: TKey): {
        hasKey: boolean;
        key?: TKey;
    };
Parameters
Type Name Description
TKey keyValue
Returns
Type Description
{ hasKey: boolean; key?: TKey; }

tryGetValueOf(keyValue)

Tries to find a value in the dictionary corresponding to the key equal to given .

Returns:

hasValue - indicates whether the value with such key was found;

value - contains value with the key equal to or null if such key was not found.

Declaration
tryGetValueOf(keyValue: TKey): {
        hasValue: boolean;
        value: TValue;
    };
Parameters
Type Name Description
TKey keyValue
Returns
Type Description
{ hasValue: boolean; value: TValue; }

values()

Declaration
values(): IterableIterator<TValue>;
Returns
Type Description
IterableIterator<TValue>
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback