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()
KNNList
public DoubleDBIDPair get(int index)
KNNList
get
in interface DoubleDBIDList
get
in interface KNNList
index
- Offsetpublic double getKNNDistance()
KNNList
getKNNDistance
in interface KNNList
public DoubleDBIDListIter iter()
DBIDs
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter
in interface DBIDs
iter
in interface DoubleDBIDList
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.