org.apache.lucene.facet.search

## 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 Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `add(T frn)` Add a new value to the heap, return the new top().
    `void` | `clear()` Clear the heap
    `T` | `insertWithOverflow(T value)` Insert a new value, returning the overflowen object NOTE: This method should not be called after invoking `pop()`
    `T` | `pop()` Get and remove the top of the Heap NOTE: Once `pop()` is called no other `add(Object)` or `insertWithOverflow(Object)` should be called.
    `int` | `size()` Return the amount of objects currently in the heap
    `T` | `top()` Get (But not remove) the top of the Heap

- - ### Method Detail

    - #### pop

          T pop()

      Get and remove the top of the Heap
      NOTE: Once `pop()` is called no other `add(Object)` or `insertWithOverflow(Object)` should be called.

    - #### 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

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.