|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<DistanceResultPair<D>> de.lmu.ifi.dbs.elki.utilities.datastructures.heap.KNNList<D>
D
- public class KNNList<D extends Distance<D>>
Finalized KNN List.
Nested Class Summary | |
---|---|
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 |
Field Summary | |
---|---|
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 |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
protected |
KNNList(KNNHeap<D> heap,
D maxdist)
Constructor, to be called from KNNHeap only! |
Method Summary | ||
---|---|---|
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
|
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()
|
Methods inherited from class java.util.ArrayList |
---|
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, size, toArray, toArray |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
private static final long serialVersionUID
private final int k
private final D extends Distance<D> maxdist
Constructor Detail |
---|
protected KNNList(KNNHeap<D> heap, D maxdist)
heap
- Calling heap.maxdist
- infinite distance to return.Method Detail |
---|
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)
add
in interface List<DistanceResultPair<D extends Distance<D>>>
add
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
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)
addAll
in interface List<DistanceResultPair<D extends Distance<D>>>
addAll
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
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)
remove
in interface List<DistanceResultPair<D extends Distance<D>>>
remove
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
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)
set
in interface List<DistanceResultPair<D extends Distance<D>>>
set
in class ArrayList<DistanceResultPair<D extends Distance<D>>>
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)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |