
P - pair typeD - distance typeabstract class AbstractKNNHeap<P extends DistanceDBIDPair<D>,D extends Distance<D>> extends Object implements KNNHeap<D>
| Modifier and Type | Field and Description | 
|---|---|
protected TiedTopBoundedHeap<P> | 
heap
The actual heap. 
 | 
| Constructor and Description | 
|---|
AbstractKNNHeap(int k)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
abstract void | 
add(P pair)
Add a pair to the heap. 
 | 
void | 
clear()
Clear the heap. 
 | 
int | 
getK()
Get the K parameter ("maxsize" internally). 
 | 
boolean | 
isEmpty()
Test if the heap is empty. 
 | 
P | 
peek()
Peek at the largest element in the heap. 
 | 
P | 
poll()
Poll the largest element from the heap. 
 | 
int | 
size()
Current size of heap. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, getKNNDistance, toKNNListprotected final TiedTopBoundedHeap<P extends DistanceDBIDPair<D>> heap
public AbstractKNNHeap(int k)
k - Maximum heap size (unless tied)public abstract void add(P pair)
pair - Pair to add.public final int getK()
KNNHeappublic int size()
KNNHeappublic P peek()
KNNHeappublic boolean isEmpty()
KNNHeappublic void clear()
KNNHeappublic P poll()
KNNHeapKNNHeap.toKNNList().