Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CollectionUtil

This class implements static methods to perform useful operations on lists, dictionaries, ...

Hierarchy

  • CollectionUtil

Index

Methods

Static binarySearch

  • binarySearch<T>(array: T[], element: T, cmp: function, startIndex?: number, endIndex?: number): number
  • Type parameters

    • T

    Parameters

    • array: T[]
    • element: T
    • cmp: function
        • (elem1: T, elem2: T): number
        • Parameters

          • elem1: T
          • elem2: T

          Returns number

    • Default value startIndex: number = 0
    • Default value endIndex: number = array.length - 1

    Returns number

Static contains2

  • contains2(array: any[], object: any): boolean

Static getLastElement

  • getLastElement<T>(array: T[]): T

Static last

  • last(array: any[]): any

Static removeDictElementIfTrue

  • removeDictElementIfTrue<S, T, V>(thisPointer: S, dict: Dictionary<T, V>, iterationFunction: function): void
  • Iterates through a dictionary and calls iterationFunction. If iterationFunction returns true the key gets stored. all stored key will finally be removed from the dictionary.

    Type parameters

    • S

    • T

    • V

    Parameters

    • thisPointer: S
    • dict: Dictionary<T, V>
    • iterationFunction: function
        • (thisPointer: S, key: T, value: V): boolean
        • Parameters

          • thisPointer: S
          • key: T
          • value: V

          Returns boolean

    Returns void

Generated using TypeDoc