K
- the type of keys.V
- the type of associated objects.public class Neighbor<K,V> extends java.lang.Object implements java.lang.Comparable<Neighbor<K,V>>
Modifier and Type | Field and Description |
---|---|
double |
distance
The distance between the query and the neighbor.
|
int |
index
The index of neighbor object in the dataset.
|
K |
key
The key of neighbor.
|
V |
value
The data object of neighbor.
|
Constructor and Description |
---|
Neighbor(K key,
V object,
int index,
double distance)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Neighbor<K,V> o) |
public K key
public V value
public int index
public double distance