Class ApproximatePriorityQueue<T>

java.lang.Object
org.apache.lucene.index.ApproximatePriorityQueue<T>

final class ApproximatePriorityQueue<T> extends Object
An approximate priority queue, which attempts to poll items by decreasing log of the weight, though exact ordering is not guaranteed. This class doesn't support null elements.
  • Field Details

    • slots

      private final List<T> slots
    • usedSlots

      private long usedSlots
  • Constructor Details

    • ApproximatePriorityQueue

      ApproximatePriorityQueue()
  • Method Details

    • add

      void add(T entry, long weight)
      Add an entry to this queue that has the provided weight.
    • poll

      T poll(Predicate<T> predicate)
      Return an entry matching the predicate. This will usually be one of the available entries that have the highest weight, though this is not guaranteed. This method returns null if no free entries are available.
    • contains

      boolean contains(Object o)
    • isEmpty

      boolean isEmpty()
    • remove

      boolean remove(Object o)