
public class KNNSubList extends Object implements KNNList
| Modifier and Type | Class and Description |
|---|---|
private class |
KNNSubList.Itr
Iterator for the sublist.
|
| Modifier and Type | Field and Description |
|---|---|
private KNNList |
inner
Wrapped inner result.
|
private int |
k
Parameter k.
|
private int |
size
Actual size, including ties.
|
| Constructor and Description |
|---|
KNNSubList(KNNList inner,
int k)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DoubleDBIDPair |
get(int index)
Direct object access.
|
int |
getK()
Get the K parameter (note: this may be less than the size of the list!)
|
double |
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleDBIDListIter |
iter()
Get a DBID iterator (a more efficient API).
|
int |
size()
Size
|
private final int k
private final int size
private final KNNList inner
public KNNSubList(KNNList inner, int k)
inner - Inner instancek - k valuepublic int getK()
KNNListpublic DoubleDBIDPair get(int index)
KNNListget in interface DoubleDBIDListget in interface KNNListindex - Offsetpublic double getKNNDistance()
KNNListgetKNNDistance in interface KNNListpublic DoubleDBIDListIter iter()
DBIDs
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter in interface DBIDsiter in interface DoubleDBIDListpublic boolean contains(DBIDRef o)
DBIDspublic boolean isEmpty()
DBIDsCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.