Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • CollectionUtil

Index

Constructors

Methods

  • binarySearch<T>(array: T[], element: T, cmp: ((elem1: T, elem2: T) => number), startIndex?: number, endIndex?: number): number
  • Type Parameters

    • T

    Parameters

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

          • elem1: T
          • elem2: T

          Returns number

    • startIndex: number = 0
    • endIndex: number = ...

    Returns number

  • contains2(array: any[], object: any): boolean
  • flat(array: any[]): any
  • getLastElement<T>(array: T[]): T
  • last(array: any[]): any
  • removeDictElementIfTrue<S, T, V>(thisPointer: S, dict: default<T, V>, iterationFunction: ((thisPointer: S, key: T, value: V) => boolean)): 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: default<T, V>
    • iterationFunction: ((thisPointer: S, key: T, value: V) => boolean)
        • (thisPointer: S, key: T, value: V): boolean
        • Parameters

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

          Returns boolean

    Returns void

Generated using TypeDoc