public class IntegerDBIDKNNSubList extends Object implements IntegerDBIDKNNList
Modifier and Type | Class and Description |
---|---|
private class |
IntegerDBIDKNNSubList.Itr
Iterator for the sublist.
|
Modifier and Type | Field and Description |
---|---|
private IntegerDBIDKNNList |
inner
Wrapped inner result.
|
private int |
k
Parameter k.
|
private int |
size
Actual size, including ties.
|
Constructor and Description |
---|
IntegerDBIDKNNSubList(IntegerDBIDKNNList inner,
int k)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DoubleIntegerDBIDPair |
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.
|
IntegerDBIDKNNSubList.Itr |
iter()
Get a DBID iterator (a more efficient API).
|
int |
size()
Size
|
private final int k
private final int size
private final IntegerDBIDKNNList inner
public IntegerDBIDKNNSubList(IntegerDBIDKNNList inner, int k)
inner
- Inner instancek
- k valuepublic int getK()
KNNList
public DoubleIntegerDBIDPair get(int index)
KNNList
get
in interface DoubleDBIDList
get
in interface IntegerDBIDKNNList
get
in interface KNNList
index
- Offsetpublic double getKNNDistance()
KNNList
getKNNDistance
in interface KNNList
public IntegerDBIDKNNSubList.Itr iter()
DBIDs
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter
in interface DBIDs
iter
in interface DoubleDBIDList
iter
in interface IntegerDBIDKNNList
iter
in interface IntegerDBIDs
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.