projects/wms-framework/src/lib/baseframework/ISimpleDictionary.ts
Interface for dictionary types.
Properties |
Methods |
addEntry | |||||||||
addEntry(key: K, value: V)
|
|||||||||
Add a entry to the dictionary
Parameters :
Returns :
any
|
containsKey | ||||||
containsKey(key: K)
|
||||||
Parameters :
Returns :
boolean
|
getItem | ||||||
getItem(key: K)
|
||||||
Parameters :
Returns :
V
|
hasKey | ||||||
hasKey(key: K)
|
||||||
Check if a key is contained in the dictionary
Parameters :
Returns :
any
|
removeEntry | ||||||
removeEntry(key: K)
|
||||||
Removes a entry to the dictionary
Parameters :
Returns :
any
|
setItem | |||||||||
setItem(key: K, value: V)
|
|||||||||
Parameters :
Returns :
void
|
tryGetValue | |||||||||
tryGetValue(key: K, value: (v: V) => void)
|
|||||||||
Tries to get a value by key in the dictionary
Parameters :
Returns :
any
|
keys |
keys:
|
Type : ICollection<K>
|
The keys collection |
values |
values:
|
Type : ICollection<V>
|
The values collection |
import { ICollection } from './collections';
/**
* Interface for dictionary types.
*
* @export
* @interface ISimpleDictionary
* @extends {ICollection<[K, V]>}
* @template K
* @template V
* @wInterface System.Collections.Generic.IDictionary`2
* @wNetSupport
*/
export interface ISimpleDictionary<K, V> extends ICollection<[K, V]> {
/**
* The keys collection
*
* @type {ICollection<K>}
* @memberof ISimpleDictionary
* @wProperty Keys
*/
readonly keys: ICollection<K>;
/**
* The values collection
*
* @type {ICollection<K>}
* @memberof ISimpleDictionary
* @wProperty Values
*/
readonly values: ICollection<V>;
getItem(key: K): V;
setItem(key: K, value: V): void;
/**
* Add a entry to the dictionary
*
* @param {K} key
* @param {V} value
* @memberof ISimpleDictionary
* @wMethod Add
*/
addEntry(key: K, value: V);
/**
* Check if a key is contained in the dictionary
*
* @param {K} key
* @param {V} value
* @memberof ISimpleDictionary
* @wMethod ContainsKey
*/
hasKey(key: K);
/**
* Removes a entry to the dictionary
*
* @param {K} key
* @param {V} value
* @memberof ISimpleDictionary
* @wMethod Remove
*/
removeEntry(key: K);
/**
* Tries to get a value by key in the dictionary
*
* @param {K} key
* @param {V} value
* @memberof ISimpleDictionary
* @wMethod TryGetValue
* @wIgnore
*/
tryGetValue(key: K, value: (v: V) => void);
containsKey(key: K): boolean;
}