D
- public class KNNList<D extends Distance<D>> extends ArrayList<DistanceResultPair<D>>
Modifier and Type | Class and Description |
---|---|
protected static class |
KNNList.DBIDItr
Proxy iterator for accessing DBIDs.
|
protected static class |
KNNList.DBIDView
A view on the DBIDs of the result
|
protected static class |
KNNList.DistanceItr<D extends Distance<D>>
Proxy iterator for accessing DBIDs.
|
protected static class |
KNNList.DistanceView<D extends Distance<D>>
A view on the Distances of the result
|
Modifier and Type | Field and Description |
---|---|
private int |
k
The value of k this was materialized for.
|
private D |
maxdist
The maximum distance to return if size() < k
|
private static long |
serialVersionUID
Serial ID
|
modCount
Modifier | Constructor and Description |
---|---|
protected |
KNNList(KNNHeap<D> heap,
D maxdist)
Constructor, to be called from KNNHeap only!
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(DistanceResultPair<D> e) |
void |
add(int index,
DistanceResultPair<D> element) |
boolean |
addAll(Collection<? extends DistanceResultPair<D>> c) |
boolean |
addAll(int index,
Collection<? extends DistanceResultPair<D>> c) |
ArrayDBIDs |
asDBIDs()
View as ArrayDBIDs
|
static ArrayDBIDs |
asDBIDs(List<? extends DistanceResultPair<?>> list)
View as ArrayDBIDs
|
List<D> |
asDistanceList()
View as list of distances
|
static <D extends Distance<D>> |
asDistanceList(List<? extends DistanceResultPair<D>> list)
View as list of distances
|
void |
clear() |
int |
getK()
Get the K parameter.
|
D |
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise.
|
D |
getMaximumDistance()
Get maximum distance in list
|
DistanceResultPair<D> |
remove(int index) |
boolean |
remove(Object o) |
DistanceResultPair<D> |
set(int index,
DistanceResultPair<D> element) |
void |
trimToSize() |
clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, removeRange, retainAll, size, subList, toArray, toArray
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
private static final long serialVersionUID
private final int k
public int getK()
public D getKNNDistance()
public D getMaximumDistance()
public ArrayDBIDs asDBIDs()
public List<D> asDistanceList()
public boolean add(DistanceResultPair<D> e)
add
in interface Collection<DistanceResultPair<D extends Distance<D>>>
add
in interface List<DistanceResultPair<D extends Distance<D>>>
add
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
public void add(int index, DistanceResultPair<D> element)
public boolean addAll(Collection<? extends DistanceResultPair<D>> c)
addAll
in interface Collection<DistanceResultPair<D extends Distance<D>>>
addAll
in interface List<DistanceResultPair<D extends Distance<D>>>
addAll
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
public boolean addAll(int index, Collection<? extends DistanceResultPair<D>> c)
public void clear()
clear
in interface Collection<DistanceResultPair<D extends Distance<D>>>
clear
in interface List<DistanceResultPair<D extends Distance<D>>>
clear
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
public DistanceResultPair<D> remove(int index)
public boolean remove(Object o)
remove
in interface Collection<DistanceResultPair<D extends Distance<D>>>
remove
in interface List<DistanceResultPair<D extends Distance<D>>>
remove
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
public DistanceResultPair<D> set(int index, DistanceResultPair<D> element)
public void trimToSize()
trimToSize
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
public static ArrayDBIDs asDBIDs(List<? extends DistanceResultPair<?>> list)
public static <D extends Distance<D>> List<D> asDistanceList(List<? extends DistanceResultPair<D>> list)