File

projects/wms-framework/src/lib/baseframework/ISimpleDictionary.ts

Description

Interface for dictionary types.

Extends

ICollection

Index

Properties
Methods

Methods

addEntry
addEntry(key: K, value: V)

Add a entry to the dictionary

Parameters :
Name Type Optional
key K No
value V No
Returns : any
containsKey
containsKey(key: K)
Parameters :
Name Type Optional
key K No
Returns : boolean
getItem
getItem(key: K)
Parameters :
Name Type Optional
key K No
Returns : V
hasKey
hasKey(key: K)

Check if a key is contained in the dictionary

Parameters :
Name Type Optional
key K No
Returns : any
removeEntry
removeEntry(key: K)

Removes a entry to the dictionary

Parameters :
Name Type Optional
key K No
Returns : any
setItem
setItem(key: K, value: V)
Parameters :
Name Type Optional
key K No
value V No
Returns : void
tryGetValue
tryGetValue(key: K, value: (v: V) => void)

Tries to get a value by key in the dictionary

Parameters :
Name Type Optional
key K No
value function No
Returns : any

Properties

keys
keys: ICollection<K>
Type : ICollection<K>

The keys collection

values
values: ICollection<V>
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;
}

result-matching ""

    No results matching ""