
public class DoubleDistanceKNNList extends Object implements KNNResult<DoubleDistance>
| Modifier and Type | Class and Description | 
|---|---|
| private class  | DoubleDistanceKNNList.ItrIterator. | 
| Modifier and Type | Field and Description | 
|---|---|
| private DoubleDistanceDBIDPair[] | dataThe actual data array. | 
| private int | kThe value of k this was materialized for. | 
| Modifier | Constructor and Description | 
|---|---|
|   | DoubleDistanceKNNList(Collection<DoubleDistanceDBIDPair> col,
                     int k)Constructor. | 
| protected  | DoubleDistanceKNNList(DoubleDistanceKNNHeap heap)Constructor, to be called from KNNHeap only. | 
|   | DoubleDistanceKNNList(Heap<DoubleDistanceDBIDPair> heap,
                     int k)Constructor, to be called from KNNHeap only. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | contains(DBIDRef o)Test whether an ID is contained. | 
| double | doubleKNNDistance()Get the kNN distance as double value. | 
| DoubleDistanceDBIDPair | get(int index)Direct object access. | 
| int | getK()Get the K parameter (note: this may be less than the size of the list!) | 
| DoubleDistance | getKNNDistance()Deprecated. 
 use doubleKNNDistance()! | 
| boolean | isEmpty()Test for an empty DBID collection. | 
| DoubleDistanceDBIDResultIter | iter()Get an iterator | 
| int | size()Size | 
| String | toString() | 
private final int k
private final DoubleDistanceDBIDPair[] data
public DoubleDistanceKNNList(Collection<DoubleDistanceDBIDPair> col, int k)
col - Existing collectionk - K parameterprotected DoubleDistanceKNNList(DoubleDistanceKNNHeap heap)
KNNHeap.toKNNList()
 instead!heap - Calling heappublic DoubleDistanceKNNList(Heap<DoubleDistanceDBIDPair> heap, int k)
KNNHeap.toKNNList()
 instead!heap - Calling heapk - Target number of neighbors (before ties)public int getK()
KNNResultgetK in interface KNNResult<DoubleDistance>@Deprecated public DoubleDistance getKNNDistance()
getKNNDistance in interface KNNResult<DoubleDistance>public double doubleKNNDistance()
public DoubleDistanceDBIDPair get(int index)
KNNResultget in interface DistanceDBIDResult<DoubleDistance>get in interface KNNResult<DoubleDistance>index - Offsetpublic DoubleDistanceDBIDResultIter iter()
DistanceDBIDResultiter in interface DBIDsiter in interface DistanceDBIDResult<DoubleDistance>public int size()
KNNResultsize in interface DBIDssize in interface DistanceDBIDResult<DoubleDistance>size in interface KNNResult<DoubleDistance>public boolean contains(DBIDRef o)
DBIDs