projects/wms-framework/src/lib/baseframework/Dictionary.ts
Base class for dictionary types.
Properties |
|
Methods |
|
Abstract count |
Type : number
|
Gets the count of elements in the dictionary |
Abstract internalArray |
Type : []
|
Abstract keys |
Type : ICollection<K>
|
The keys collection |
Abstract values |
Type : ICollection<V>
|
The values collection |
Abstract add | ||||||
add(value: [K, V])
|
||||||
Parameters :
Returns :
void
|
Abstract addEntry | |||||||||
addEntry(key: K, value: V)
|
|||||||||
Add a value to the dictionary
Parameters :
Returns :
any
|
Abstract clear |
clear()
|
Clears the dictionary
Returns :
void
|
Abstract contains | ||||||
contains(value: [K, V])
|
||||||
Parameters :
Returns :
boolean
|
Abstract containsKey | ||||||
containsKey(key: K)
|
||||||
Parameters :
Returns :
boolean
|
Abstract copyTo | |||||||||
copyTo(target: [], index: number)
|
|||||||||
Parameters :
Returns :
void
|
Abstract getItem | ||||||
getItem(key: K)
|
||||||
Parameters :
Returns :
V
|
Abstract hasKey | ||||||
hasKey(key: K)
|
||||||
Checks if the dictionary has a key
Parameters :
Returns :
any
|
Abstract remove | ||||||
remove(value: [K, V])
|
||||||
Parameters :
Returns :
boolean
|
Abstract removeEntry | ||||||
removeEntry(key: K)
|
||||||
Removes an entry from the dictionay by key
Parameters :
Returns :
any
|
Abstract setItem | |||||||||
setItem(key: K, value: V)
|
|||||||||
Parameters :
Returns :
void
|
Abstract tryGetValue | |||||||||
tryGetValue(key: K, value: (v: V) => void)
|
|||||||||
Tries to get a value by key
Parameters :
Returns :
any
|
Abstract |
()
|
Returns :
Iterator<, any, undefined>
|
import { ICollection } from './collections';
import { ISimpleDictionary } from './ISimpleDictionary';
/**
* Base class for dictionary types.
*
* @export
* @abstract
* @class Dictionary
* @implements {ISimpleDictionary<K, V>}
* @template K
* @template V
* @wType System.Collections.Generic.Dictionary`2
* @wNetSupport
*/
export abstract class Dictionary<K, V> implements ISimpleDictionary<K, V> {
/**
* The keys collection
*
* @abstract
* @type {ICollection<K>}
* @memberof Dictionary
* @wProperty Keys
*/
abstract keys: ICollection<K>;
/**
* The values collection
*
* @abstract
* @type {ICollection<V>}
* @memberof Dictionary
* @wProperty Values
*/
abstract values: ICollection<V>;
/**
* Gets the count of elements in the dictionary
*
* @abstract
* @type {number}
* @memberof Dictionary
* @wProperty Count
*/
abstract count: number;
abstract internalArray: [K, V][];
abstract getItem(key: K): V;
abstract setItem(key: K, value: V): void;
/**
* Add a value to the dictionary
*
* @abstract
* @param {[K, V]} value
* @memberof Dictionary
* @wMethod Add
*/
abstract addEntry(key: K, value: V);
/**
* Checks if the dictionary has a key
*
* @abstract
* @param {K} key
* @memberof Dictionary
* @wMethod ContainsKey
*/
abstract hasKey(key: K);
/**
* Removes an entry from the dictionay by key
*
* @abstract
* @param {K} key
* @memberof Dictionary
* @wMethod Remove
*/
abstract removeEntry(key: K);
/**
* Tries to get a value by key
*
* @abstract
* @param {K} key
* @param {(v: V) => void} value
* @memberof Dictionary
* @wMethod TryGetValue
* @wIgnore
*/
abstract tryGetValue(key: K, value: (v: V) => void);
abstract containsKey(key: K): boolean;
abstract add(value: [K, V]): void;
/**
* Clears the dictionary
*
* @abstract
* @memberof Dictionary
* @wMethod Clear
*/
abstract clear(): void;
abstract contains(value: [K, V]): boolean;
abstract remove(value: [K, V]): boolean;
abstract copyTo(target: [K, V][], index: number): void;
abstract [Symbol.iterator](): Iterator<[K, V], any, undefined>;
}