Package org.apache.lucene.index
Class ApproximatePriorityQueue<T>
- java.lang.Object
-
- org.apache.lucene.index.ApproximatePriorityQueue<T>
-
final class ApproximatePriorityQueue<T> extends java.lang.ObjectAn 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.
-
-
Constructor Summary
Constructors Constructor Description ApproximatePriorityQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(T entry, long weight)Add an entry to this queue that has the provided weight.(package private) booleancontains(java.lang.Object o)(package private) booleanisEmpty()(package private) Tpoll(java.util.function.Predicate<T> predicate)Return an entry matching the predicate.(package private) booleanremove(java.lang.Object o)
-
-
-
Field Detail
-
slots
private final java.util.List<T> slots
-
usedSlots
private long usedSlots
-
-
Method Detail
-
add
void add(T entry, long weight)
Add an entry to this queue that has the provided weight.
-
poll
T poll(java.util.function.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 returnsnullif no free entries are available.
-
contains
boolean contains(java.lang.Object o)
-
isEmpty
boolean isEmpty()
-
remove
boolean remove(java.lang.Object o)
-
-