public class DoubleDistanceKNNSubList extends Object implements DoubleDistanceKNNList
Modifier and Type | Class and Description |
---|---|
private class |
DoubleDistanceKNNSubList.Itr
Iterator for the sublist.
|
Modifier and Type | Field and Description |
---|---|
private DoubleDistanceKNNList |
inner
Wrapped inner result.
|
private int |
k
Parameter k.
|
private int |
size
Actual size, including ties.
|
Constructor and Description |
---|
DoubleDistanceKNNSubList(DoubleDistanceKNNList inner,
int k)
Constructor.
|
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.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleDistanceDBIDListIter |
iter()
Get an iterator
|
int |
size()
Size
|
private final int k
private final int size
private final DoubleDistanceKNNList inner
public DoubleDistanceKNNSubList(DoubleDistanceKNNList inner, int k)
inner
- Inner instancek
- k valuepublic int getK()
KNNList
getK
in interface KNNList<DoubleDistance>
public DoubleDistanceDBIDPair get(int index)
KNNList
get
in interface DistanceDBIDList<DoubleDistance>
get
in interface DoubleDistanceKNNList
get
in interface KNNList<DoubleDistance>
index
- Offset@Deprecated public DoubleDistance getKNNDistance()
DoubleDistanceKNNList
getKNNDistance
in interface DoubleDistanceKNNList
getKNNDistance
in interface KNNList<DoubleDistance>
public double doubleKNNDistance()
DoubleDistanceKNNList
doubleKNNDistance
in interface DoubleDistanceKNNList
public DoubleDistanceDBIDListIter iter()
DistanceDBIDList
iter
in interface DBIDs
iter
in interface DistanceDBIDList<DoubleDistance>
iter
in interface DoubleDistanceKNNList
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs
public int size()
KNNList
size
in interface DBIDs
size
in interface DistanceDBIDList<DoubleDistance>
size
in interface KNNList<DoubleDistance>