Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • Parameters

    • Default value data: any = null

    Returns HashMapObject

Properties

Protected _data

_data: object

Type declaration

  • [key: string]: any

Protected _keys

_keys: string[] = []

Protected _length

_length: number = 0

Static SORT_METHOD_NUMERIC

SORT_METHOD_NUMERIC: "SORT_METHOD_NUMERIC" = "SORT_METHOD_NUMERIC"

Static SORT_METHOD_STRING

SORT_METHOD_STRING: "SORT_METHOD_STRING" = "SORT_METHOD_STRING"

Static SORT_ORDER_ASCENDING

SORT_ORDER_ASCENDING: "SORT_ORDER_ASCENDING" = "SORT_ORDER_ASCENDING"

Static SORT_ORDER_DESCENDING

SORT_ORDER_DESCENDING: "SORT_ORDER_DESCENDING" = "SORT_ORDER_DESCENDING"

Methods

Private _validateKeyFormat

  • _validateKeyFormat(key: any): void
  • Parameters

    • key: any

    Returns void

    void

get

  • get(key: string): any
  • Parameters

    • key: string

    Returns any

    The value that is associated to the provided key

getAt

  • getAt(index: number): any
  • Parameters

    • index: number

    Returns any

    The value that is located at the specified position

getKeys

  • getKeys(): string[]
  • Returns string[]

    List of strings containing all the HashMapObject sorted keys.

getValues

  • getValues(): any[]
  • Returns any[]

    List of elements containing all the HashMapObject sorted values

isKey

  • isKey(key: any): boolean
  • Parameters

    • key: any

    Returns boolean

    True if the provided value is a valid HashMap key, false in any other case

length

  • length(): number
  • Returns number

    integer The number of items inside the collection

pop

  • pop(): any
  • Returns any

    The value on the last element of the list

remove

  • remove(key: any): any
  • Parameters

    • key: any

    Returns any

    The value from the key/value pair that's been deleted.

rename

  • rename(key: any, newKey: any): boolean
  • Parameters

    • key: any
    • newKey: any

    Returns boolean

    True if rename was successful

reverse

  • reverse(): boolean
  • Returns boolean

    void

set

  • set(key: string, value: any): any
  • Parameters

    • key: string
    • value: any

    Returns any

    The value after being stored to the collection

shift

  • shift(): any
  • Returns any

    The value on the first element of the list

sortByKey

  • sortByKey(method?: string, order?: string): boolean
  • Parameters

    • Default value method: string = HashMapObject.SORT_METHOD_STRING
    • Default value order: string = HashMapObject.SORT_ORDER_ASCENDING

    Returns boolean

    True if sort was successful false on failure

swap

  • swap(key1: string, key2: string): boolean
  • Parameters

    • key1: string
    • key2: string

    Returns boolean

    True if the two key/value pairs positions were correctly exchanged

Generated using TypeDoc