Class BTreeQueue<E>

java.lang.Object
com.oracle.truffle.runtime.collection.BTreeQueue<E>

public final class BTreeQueue<E> extends Object
Queue implementation based on the B-tree data structure.

The elements in the queue are ordered, and placed into leaf nodes. Each leaf node has at most BRANCHING_FACTOR elements, and each inner node has at most BRANCHING_FACTOR elements. The tree is kept balanced so that all the leaves are at the same depth. Nodes whose entry-count drops below a particular value are compressed to avoid wasting space.

  • Constructor Details

    • BTreeQueue

      public BTreeQueue()
  • Method Details

    • add

      public void add(E x)
    • addIndexOf

      public int addIndexOf(E x)
    • indexOf

      public int indexOf(E x)
    • indexBefore

      public int indexBefore(E x)
    • poll

      public E poll()
    • peek

      public E peek()
    • clear

      public void clear()
    • size

      public int size()
    • toArray

      public Object[] toArray()
    • toArray

      public <T> T[] toArray(T[] a)
    • internalCapacity

      public int internalCapacity()
    • checkInvariants

      public void checkInvariants()
    • prettyString

      public String prettyString()