
P - pair typeD - distance typepublic abstract class AbstractKNNHeap<P extends DistanceDBIDPair<D>,D extends Distance<D>> extends Object implements KNNHeap<D>
| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | AbstractKNNHeap.CompComparator to use. | 
| Modifier and Type | Field and Description | 
|---|---|
| static Comparator<? super DistanceDBIDPair<?>> | COMPARATORStatic comparator. | 
| protected TiedTopBoundedHeap<P> | heapThe 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, toKNNListpublic static final Comparator<? super DistanceDBIDPair<?>> COMPARATOR
protected 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().