Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains factory functions for creating instances of commonly used ADTs.

Index

Functions

collectionFromArray

  • collectionFromArray<E>(array: E[], copyArray?: boolean): Collection<E>
  • Creates new instance of Collection that contains all items from the given array. The instance doesn't depends on underlying array, IOW changes in the array won't affect the container.

    Type parameters

    • E

    Parameters

    • array: E[]

      array to copy items from.

    • Default value copyArray: boolean = true

      defines either elements from given array will be copied into the result collection or given array will be reused by the collection. Be aware that in the second case changes in the array mean changes in the collection. By default it copies the array.

    Returns Collection<E>

    new instance of Collection.

emptyCollection

numberComparator

  • numberComparator(left: number, right: number): Ordering

stringComparator

  • stringComparator(left: string, right: string): Ordering
  • Compares two numbers. Uses default lexicographical string comparison.

    Parameters

    • left: string
    • right: string

    Returns Ordering

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc