Interface Container<T>

container interface

Remarks

Describes the methods and properties that all containers have

Type Parameters

  • T

Hierarchy

Implemented by

Properties

capacity: number

Returns the current capacity of the container

isEmpty: boolean

Returns true if there is no data in the container

isFull: boolean

Returns true if the container has reached the container limit

isNotEmpty: boolean

Returns true if there is data in the container

isNotFull: boolean

Returns true if the container has not reached the container limit

length: number

Returns the current amount of data in the container

Accessors

  • get reverse(): Iterable<T>
  • Returns an object that implements a js Iterable, but it traverses the data in reverse

    Returns Iterable<T>

Methods

  • Returns Iterator<T, any, undefined>

  • Traverse the container looking for elements until the callback returns true, then stop looking

    Returns

    whether the element was found

    Parameters

    • callback: ValidCallback<T>

      Determine whether it is the element to be found

    • Optional reverse: boolean

      If true, traverse the container in reverse order

    Returns boolean

  • call callback on each element in the container in turn

    Parameters

    • callback: ValueCallback<T>
    • Optional reverse: boolean

      If true, traverse the container in reverse order

    Returns void

  • Returns whether the data data exists in the container

    Parameters

    • data: T
    • Optional reverse: boolean

      If true, traverse the container in reverse order

    • Optional callback: CompareCallback<T>

    Returns boolean

  • Returns a js iterator

    Parameters

    • Optional reverse: boolean

      If true, returns an iterator to traverse in reverse

    Returns Iterator<T, any, undefined>

  • Adds all the elements of an container into a string, separated by the specified separator string.

    Parameters

    • Optional separator: string

    Returns string

  • Convert container to array

    Type Parameters

    • TO

    Parameters

    • callback: MapCallback<T, TO>
    • Optional reverse: boolean

      If true, traverse the container in reverse order

    Returns TO[]

Generated using TypeDoc