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