Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AList defines a list of typed objects.

Type parameters

  • T

Hierarchy

  • AList

Implements

  • IList

Index

Constructors

  • new AList<T>(genericType: string): AList<T>
  • Create a new list.

    Type parameters

    • T

    Parameters

    • genericType: string

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

    Returns AList<T>

Methods

  • [iterator](): { next: any }
  • Get an iterator to use in "for of" loops.

    Returns { next: any }

    • next:function
      • next(): IteratorResult<T, any>
      • Returns IteratorResult<T, any>

  • add(element: T): void
  • Add an element.

    Parameters

    • element: T

      the element to add.

    Returns void

  • addAt(index: number, element: T): void
  • Add an element at a certain index.

    Parameters

    • index: number

      the index to add at.

    • element: T

      the element to add.

    Returns void

  • addList(list: AList<T>): void
  • Add a list of elements.

    Parameters

    • list: AList<T>

      the list.

    Returns void

  • addObject(element: Object): void
  • Add an untyped object.

    Parameters

    • element: Object

      the element to add.

    Returns void

  • addObjectList(list: AList<Object>): void
  • Add a list of untyped objects.

    Parameters

    • list: AList<Object>

      the list.

    Returns void

  • clear(): void
  • Clear the list.

    Returns void

  • get(index: number): T
  • Get an element.

    Parameters

    • index: number

      the index of the element.

    Returns T

    the element.

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

    Returns string

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

  • getObject(index: number): Object
  • Get an untyped object.

    Parameters

    • index: number

      the index of the object.

    Returns Object

    the element.

  • removeAt(index: number): T
  • Remove an element.

    Parameters

    • index: number

      the index to remove at.

    Returns T

    the removed element.

  • set(index: number, element: T): void
  • Set an element.

    Parameters

    • index: number

      the index of the element.

    • element: T

      the element.

    Returns void

  • setObject(index: number, element: Object): void
  • Set an untyped element.

    Parameters

    • index: number

      the index of the element.

    • element: Object

      the element.

    Returns void

  • size(): number
  • Get the number of elements.

    Returns number

    the number of elements.

  • toArray(): T[]
  • Get a native array.

    Returns T[]

    a native array.

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

    Returns string

    the string form of the object.

  • fromArray<T2>(list: T2[], genericType: string): AList<T2>
  • Create a list from a native array.

    Type parameters

    • T2

    Parameters

    • list: T2[]
    • genericType: string

    Returns AList<T2>

    AList