Skip to content
FutureBlitz

    Install

    Import std.collections.deque

    std.collections.deque

    Deque<T>: values added and taken at either end. Front holds the first values backwards, so both ends are at the end of an array, and when one side runs out as values are taken, it takes half of the other.

    std/collections/deque.fb

    Types

    Deque class

    @DebugElements Public Class Deque<T> Implements Iterable<T>, Cloneable, Defaultable

    A double-ended queue: values go on and come off at either end.

    std/collections/deque.fb, line 9

    • Public Property Count: Int property #

      How many values it holds.

    • @PanicsAtCaller Public Method AddFirst(value: T) method #

      Puts value at the front. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics.

    • @PanicsAtCaller Public Method AddLast(value: T) method #

      Puts value at the back. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics.

    • @PanicsAtCaller Public Method Add(value: T) method #

      The same as AddLast.

    • @PanicsAtCaller Public Method AddAll(values: Iterable<T>) method #

      Adds each of the values last, in order.

    • @PanicsAtCaller Public Method RemoveFirst(): T method #

      Takes the first value off and gives it. Panics when the Deque is empty.

    • @PanicsAtCaller Public Method RemoveLast(): T method #

      Takes the last value off and gives it. Panics when the Deque is empty.

    • @PanicsAtCaller Public Method First(): T method #

      The first value, which stays, as everything else does. Panics when the Deque is empty.

    • @PanicsAtCaller Public Method Last(): T method #

      The last value, which stays, as everything else does. Panics when the Deque is empty.

    • Public Method TryRemoveFirst(): T? method #

      Takes the first value off and gives it, or Null when the Deque is empty.

    • Public Method TryRemoveLast(): T? method #

      Takes the last value off and gives it, or Null when the Deque is empty.

    • Public Method TryFirst(): T? method #

      The first value, which stays, or Null when the Deque is empty.

    • Public Method TryLast(): T? method #

      The last value, which stays, or Null when the Deque is empty.

    • @PanicsAtCaller Operator [](index: Int): T operator #

      The value at index, counting from the first, which is 0. Panics unless index is from 0 to Count minus 1.

    • @PanicsAtCaller Operator []=(index: Int, value: T) operator #

      Gives the value at index, counting from the first, a new value. Panics unless index is from 0 to Count minus 1.

    • Public Method Contains(value: T): Bool method #

      Whether it holds value.

    • Public Method ToArray(): T[] method #

      The values from first to last, in a new array.

    • Public Method Clear() method #

      Takes every value out.

    • Public Static Method DefaultValue(): Deque<T> static method #

      A new, empty Deque.

    • Public Method Clone(): Deque<T> method #

      A new Deque with the same values.

    • Public Method Iterate(): DequeIterator<T> method #

      The values from first to last. Adding or removing a value while going over them panics.

    DequeIterator struct

    Public Struct DequeIterator<T> Implements Iterator<T>

    Front's values backwards from FrontLeft, then Back's from BackAt on.

    std/collections/deque.fb, line 205

    Report an issue with this page or with FutureBlitz on GitHub.