the-algorithm/ann/src/main/java/com/twitter/ann/hnsw/DistancedItem.java
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
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.
2023-03-31 17:36:31 -05:00

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;
}
}