Interface ItemDistance
-
- All Known Implementing Classes:
GeometryItemDistance
public interface ItemDistanceA function method which computes the distance between twoItemBoundables in anSTRtree. Used for Nearest Neighbour searches.To make a distance function suitable for querying a single index tree via
STRtree.nearestNeighbour(ItemDistance), the function should have a non-zero reflexive distance. That is, if the two arguments are the same object, the distance returned should be non-zero. If it is required that only pairs of distinct items be returned, the distance function must be anti-reflexive, and must returnDouble.MAX_VALUEfor identical arguments.- Author:
- Martin Davis
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doubledistance(ItemBoundable item1, ItemBoundable item2)Computes the distance between two items.
-
-
-
Method Detail
-
distance
double distance(ItemBoundable item1, ItemBoundable item2)
Computes the distance between two items.- Parameters:
item1-item2-- Returns:
- the distance between the items
- Throws:
java.lang.IllegalArgumentException- if the metric is not applicable to the arguments
-
-