Class Heap<T>

java.lang.Object
com.ibm.wala.util.collections.Heap<T>
Direct Known Subclasses:
TabulationSolver.Worklist, Worklist

public abstract class Heap<T> extends Object
Simple Heap data structure.
  • Constructor Details

    • Heap

      public Heap(int initialCapacity)
  • Method Details

    • compareElements

      protected abstract boolean compareElements(T elt1, T elt2)
      Returns:
      true iff elt1 is considered < elt2
    • size

      public int size()
      Returns:
      number of elements in this heap
    • isEmpty

      public final boolean isEmpty()
      Returns:
      true iff this heap is non-empty
    • insert

      public void insert(T elt)
    • take

      public T take() throws NoSuchElementException
      Returns:
      the first object in the priority queue
      Throws:
      NoSuchElementException
    • toString

      public String toString()
      Overrides:
      toString in class Object