SortedMap Class
Package: @esfx/collections-sortedmap
Declaration
export declare class SortedMap<K, V> implements KeyedCollection<K, V>
Constructors
constructor(comparer)
Constructs a new instance of the SortedMap
class
Declaration
constructor(comparer?: Comparison<K> | Comparer<K>);
Parameters
- comparer
- Comparison<K> | Comparer<K>
constructor(iterable, comparer)
Constructs a new instance of the SortedMap
class
Declaration
constructor(iterable?: Iterable<[K, V]>, comparer?: Comparison<K> | Comparer<K>);
Parameters
- iterable
- Iterable<[K, V]>
- comparer
- Comparison<K> | Comparer<K>
Properties
[KeyedCollection.size]
Declaration
get [KeyedCollection.size](): number;
Property Value
[Symbol.toStringTag]
Declaration
[Symbol.toStringTag]: string;
Property Value
comparer
Declaration
get comparer(): Comparer<K>;
Property Value
Comparer<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.get](key)
Declaration
[KeyedCollection.get](key: K): V | undefined;
Parameters
- key
- K
Returns
V | undefined
[KeyedCollection.has](key)
Declaration
[KeyedCollection.has](key: K): boolean;
Parameters
- key
- K
Returns
[KeyedCollection.keys]()
Declaration
[KeyedCollection.keys](): IterableIterator<K>;
Returns
IterableIterator<K>
[KeyedCollection.set](key, value)
Declaration
[KeyedCollection.set](key: K, value: V): void;
Parameters
- key
- K
- value
- V
Returns
void
[KeyedCollection.values]()
Declaration
[KeyedCollection.values](): IterableIterator<V>;
Returns
IterableIterator<V>
[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
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?: unknown): void;
Parameters
- callback
- (value: V, key: K, map: this) => void
- thisArg
- unknown
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(): IterableIterator<K>;
Returns
IterableIterator<K>
set(key, value)
Declaration
set(key: K, value: V): this;
Parameters
- key
- K
- value
- V
Returns
this
values()
Declaration
values(): IterableIterator<V>;
Returns
IterableIterator<V>