Modifier and Type | Class and Description |
---|---|
private class |
GenericKNNList.Itr
Iterator.
|
Modifier and Type | Field and Description |
---|---|
private Object[] |
data
The actual data array.
|
private int |
k
The value of k this was materialized for.
|
Modifier | Constructor and Description |
---|---|
|
GenericKNNList(Heap<? extends DistanceDBIDPair<D>> heap,
int k)
Constructor.
|
protected |
GenericKNNList(KNNHeap<D> heap)
Constructor, to be called from KNNHeap only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DistanceDBIDPair<D> |
get(int index)
Direct object access.
|
int |
getK()
Get the K parameter (note: this may be less than the size of the list!)
|
D |
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DistanceDBIDResultIter<D> |
iter()
Get an iterator
|
int |
size()
Size
|
String |
toString() |
private final int k
private final Object[] data
protected GenericKNNList(KNNHeap<D> heap)
KNNHeap.toKNNList()
instead!heap
- Calling heappublic GenericKNNList(Heap<? extends DistanceDBIDPair<D>> heap, int k)
KNNHeap.toKNNList()
instead!heap
- Calling heapk
- K valuepublic int getK()
KNNResult
public D getKNNDistance()
KNNResult
getKNNDistance
in interface KNNResult<D extends Distance<D>>
public DistanceDBIDPair<D> get(int index)
KNNResult
public DistanceDBIDResultIter<D> iter()
DistanceDBIDResult
public int size()
KNNResult
public boolean contains(DBIDRef o)
DBIDs