Interface Heap<T>


  • public interface Heap<T>
    Declares an interface for heap (and heap alike) structures, handling a given type T
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Method Detail

      • top

        T top()
        Get (But not remove) the top of the Heap
      • insertWithOverflow

        T insertWithOverflow​(T value)
        Insert a new value, returning the overflowen object
        NOTE: This method should not be called after invoking pop()
      • add

        T add​(T frn)
        Add a new value to the heap, return the new top().
        Some implementations may choose to not implement this functionality. In such a case null should be returned.
        NOTE: This method should not be called after invoking pop()
      • clear

        void clear()
        Clear the heap
      • size

        int size()
        Return the amount of objects currently in the heap