Class EditableQueue<T>

An EditableQueue is a queue from which items may be removed and rearranged outside of the normal push() and pop() methods. It offers the additonal operations:

  • promote{ByIndex}(): move an item toward the start/front of the queue by a given number of slots (default 1)
  • demote{ByIndex}(): move an item toward the end/back of the queue by a given number of slots (default 1)
  • promote{ByIndex}ToStart(): move an item all the way to the start/front
  • demote{ByIndex}ToEnd(): move an item all the way to the end/back
  • delete(): remove an arbitrary item from the queue by index
  • remove(): remove an arbitrary item from the queue
  • clear(): remove all items from the queue

Typeparam

T : the type of items in this EditableQueue

Type Parameters

  • T

Hierarchy (view full)

Constructors

Properties

internal: LinkedList<T>

Accessors

  • get isEmpty(): boolean
  • Returns boolean

  • get items(): T[]
  • Returns T[]

  • get length(): number
  • Returns number

Methods

  • Parameters

    • item: T
    • Optional slots: number

    Returns this

  • Parameters

    • predicate: ((it) => boolean)
        • (it): boolean
        • Parameters

          • it: T

          Returns boolean

    • Optional slots: number

    Returns this

  • Parameters

    • index: number
    • slots: number = 1

    Returns this

  • Parameters

    • index: number

    Returns this

  • Parameters

    • item: T

    Returns this

  • Parameters

    • predicate: ((it) => boolean)
        • (it): boolean
        • Parameters

          • it: T

          Returns boolean

    Returns this

  • Parameters

    • item: T
    • Optional slots: number

    Returns this

  • Parameters

    • predicate: ((it) => boolean)
        • (it): boolean
        • Parameters

          • it: T

          Returns boolean

    • Optional slots: number

    Returns this

  • Parameters

    • index: number
    • slots: number = 1

    Returns this

  • Parameters

    • index: number

    Returns this

  • Parameters

    • item: T

    Returns this

  • Parameters

    • predicate: ((it) => boolean)
        • (it): boolean
        • Parameters

          • it: T

          Returns boolean

    Returns this