Package deltix.data.stream.pq
Class PriorityQueueExt<T>
- java.lang.Object
-
- deltix.data.stream.pq.PriorityQueueExt<T>
-
@ParametersAreNonnullByDefault public final class PriorityQueueExt<T> extends java.lang.Object
Binary heap-based priority queue.Optimizations (compared to
PriorityQueueExt
):- We not extract keys from objects when comparing them. Instead we store keys in separate array.
- When root removed, we don't update tree structure immediately. Instead we mark that root is missing and update structure
-
-
Constructor Summary
Constructors Constructor Description PriorityQueueExt(int capacity, boolean ascending)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
dump(java.io.PrintStream ps)
void
dump(java.io.PrintStream ps, java.lang.String indent, int pos)
boolean
isEmpty()
void
offer(T obj, long objKey)
long
peekKey()
T
poll()
boolean
remove(T obj)
int
size()
-
-
-
Method Detail
-
dump
public void dump(java.io.PrintStream ps)
-
dump
public void dump(java.io.PrintStream ps, java.lang.String indent, int pos)
-
clear
public void clear()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
offer
public void offer(T obj, long objKey)
-
remove
public boolean remove(T obj)
-
poll
@Nullable public T poll()
-
peekKey
public long peekKey()
- Returns:
- returns current key of root.
-
-