Class ObjectDeque<T>

Type Parameters

  • T = number

Hierarchy

  • ObjectDeque

Constructors

  • Type Parameters

    • T = number

    Parameters

    • Optional capacity: number

    Returns ObjectDeque<T>

Properties

_capacity: any
_first: any
_last: any
_nodes: any
_size: any

Accessors

  • get capacity(): number
  • Returns number

  • set capacity(value): void
  • Parameters

    • value: number

    Returns void

  • get first(): number
  • Returns number

  • set first(value): void
  • Parameters

    • value: number

    Returns void

  • get last(): number
  • Returns number

  • set last(value): void
  • Parameters

    • value: number

    Returns void

  • get nodes(): {
        [p: number]: T;
    }
  • Returns {
        [p: number]: T;
    }

    • [p: number]: T
  • get size(): number
  • Returns number

Methods

  • Parameters

    • value: {
          [p: number]: T;
      }
      • [p: number]: T

    Returns void

  • Parameters

    • value: number

    Returns void

  • The "addFirst" function adds a value to the beginning of an array-like data structure.

    Parameters

    • value: T

      The value parameter represents the value that you want to add to the beginning of the data structure.

    Returns void

  • The addLast function adds a value to the end of an array-like data structure.

    Parameters

    • value: T

      The value parameter represents the value that you want to add to the end of the data structure.

    Returns void

  • The get function returns the element at the specified index in an array-like data structure.

    Parameters

    • index: number

      The index parameter is a number that represents the position of the element you want to retrieve from the array.

    Returns null | NonNullable<T>

    The element at the specified index in the _nodes array is being returned. If there is no element at that index, null is returned.

  • The function checks if the size of a data structure is less than or equal to zero.

    Returns boolean

    The method is returning a boolean value indicating whether the size of the object is less than or equal to 0.

  • The peekFirst function returns the first element in an array-like data structure if it exists.

    Returns undefined | T

    The element at the first position of the _nodes array.

  • The peekLast() function returns the last element in an array-like data structure.

    Returns undefined | T

    The last element in the array "_nodes" is being returned.

  • The function pollFirst() removes and returns the first element in a data structure.

    Returns undefined | T

    The value of the first element in the data structure.

  • The pollLast() function removes and returns the last element in a data structure.

    Returns undefined | T

    The value that was removed from the data structure.

Generated using TypeDoc