mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 16:58:46 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
24 lines
417 B
Java
24 lines
417 B
Java
package com.twitter.ann.hnsw;
|
|
|
|
/**
|
|
* An item associated with a float distance
|
|
* @param <T> The type of the item.
|
|
*/
|
|
public class DistancedItem<T> {
|
|
private final T item;
|
|
private final float distance;
|
|
|
|
public DistancedItem(T item, float distance) {
|
|
this.item = item;
|
|
this.distance = distance;
|
|
}
|
|
|
|
public T getItem() {
|
|
return item;
|
|
}
|
|
|
|
public float getDistance() {
|
|
return distance;
|
|
}
|
|
}
|