Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AMap defines a map of typed key-value pairs.

Type parameters

  • T

Hierarchy

  • AMap

Implements

  • IMap

Index

Constructors

  • new AMap<T>(genericType: string): AMap<T>
  • Create a new map.

    Type parameters

    • T

    Parameters

    • genericType: string

      the generic type of the elements in the map, like MapObject.TYPE for example.

    Returns AMap<T>

Methods

  • clear(): void
  • Clear the map.

    Returns void

  • get(key: string): T
  • Get a value.

    Parameters

    • key: string

      the key.

    Returns T

    the value (null if not found).

  • get2(key: string, defaultValue: T): T
  • Get a value with an optional default.

    Parameters

    • key: string

      the key.

    • defaultValue: T

      the default value.

    Returns T

    the value, or the default value if the key was not found.

  • getBoolean2(key: string, defaultValue: boolean): boolean
  • Get a boolean value.

    Parameters

    • key: string

      the key.

    • defaultValue: boolean

      the default value to return if the key is not found.

    Returns boolean

    a value.

  • getFloat2(key: string, defaultValue: number): number
  • Get a float value.

    Parameters

    • key: string

      the key.

    • defaultValue: number

      the default value to return if the key is not found.

    Returns number

    a value.

  • getGenericType(): string
  • Get the generic type of the elements.

    Returns string

    the generic type of the elements, like MapObject.TYPE for example.

  • getInt2(key: string, defaultValue: number): number
  • Get an integer value.

    Parameters

    • key: string

      the key.

    • defaultValue: number

      the default value to return if the key is not found.

    Returns number

    a value.

  • getObject2(key: string, defaultValue: Object): Object
  • Get an object value.

    Parameters

    • key: string

      the key.

    • defaultValue: Object

      the default value to return if the key is not found.

    Returns Object

    a value.

  • getString2(key: string, defaultValue: string): string
  • Get a string value.

    Parameters

    • key: string

      the key.

    • defaultValue: string

      the default value to return if the key is not found.

    Returns string

    a value.

  • listKeys(): AList<string>
  • List all keys.

    Returns AList<string>

    all keys.

  • List all values.

    Returns AList<T>

    all values.

  • remove(key: string): void
  • Remove an element.

    Parameters

    • key: string

      the key of the element to remove.

    Returns void

  • set(key: string, value: T): void
  • Set a value.

    Parameters

    • key: string

      the key.

    • value: T

      the value.

    Returns void

  • setBoolean(key: string, value: boolean): void
  • Set a boolean value.

    Parameters

    • key: string

      the key.

    • value: boolean

      the value to set.

    Returns void

  • setFloat(key: string, value: number): void
  • Set a float value.

    Parameters

    • key: string

      the key.

    • value: number

      the value to set.

    Returns void

  • setInt(key: string, value: number): void
  • Set an integer value.

    Parameters

    • key: string

      the key.

    • value: number

      the value to set.

    Returns void

  • setObject(key: string, value: Object): void
  • Set an object value.

    Parameters

    • key: string

      the key.

    • value: Object

      the value to set.

    Returns void

  • setString(key: string, value: string): void
  • Set a string value.

    Parameters

    • key: string

      the key.

    • value: string

      the value to set.

    Returns void

  • toObject(): object
  • Returns this instance as a plain javascript object.

    Returns object

    an javascript object instance.

  • toString(): string
  • Convert the object to a string.

    Returns string

    the string form of the object.