|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.KNNList<D>
public class KNNList<D extends Distance<D>>
A wrapper class for storing the k most similar comparable objects.
| Field Summary | |
|---|---|
private D |
infiniteDistance
The infinite distance. |
private int |
k
The maximum size of this list. |
private SortedSet<QueryResult<D>> |
list
The underlying set. |
| Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debug |
| Constructor Summary | |
|---|---|
KNNList(int k,
D infiniteDistance)
Creates a new KNNList with the specified parameters. |
|
| Method Summary | |
|---|---|
boolean |
add(QueryResult<D> o)
Adds a new object to this list. |
List<D> |
distancesToList()
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one. |
int |
getK()
Returns the maximum size of this list. |
D |
getKNNDistance()
Returns the k-th distance of this list (e.g. the key of the k-th element). |
D |
getMaximumDistance()
Returns the maximum distance of this list (e.g. the key of the last element). |
int |
hashCode()
|
List<Integer> |
idsToList()
|
int |
size()
Returns the current size of this list. |
List<QueryResult<D>> |
toList()
Returns a list representation of this KList. |
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private SortedSet<QueryResult<D extends Distance<D>>> list
private int k
private D extends Distance<D> infiniteDistance
| Constructor Detail |
|---|
public KNNList(int k,
D infiniteDistance)
k - the number k of objects to be storedinfiniteDistance - the infinite distance| Method Detail |
|---|
public boolean add(QueryResult<D> o)
o - the object to be added
public D getKNNDistance()
public D getMaximumDistance()
public List<QueryResult<D>> toList()
public List<D> distancesToList()
public List<Integer> idsToList()
public int size()
public int getK()
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objecto - the reference object with which to compare.
true if this object is the same as the obj
argument; false otherwise.public int hashCode()
hashCode in class Object
|
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||