Package org.tinspin.index
Interface RectangleIndex<T>
-
- All Superinterfaces:
Index<T>
- All Known Implementing Classes:
PHTreeR,QuadTreeRKD,QuadTreeRKD0,RectArray,RTree
public interface RectangleIndex<T> extends Index<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidinsert(double[] lower, double[] upper, T value)Insert a rectangle.QueryIterator<RectangleEntry<T>>iterator()default RectangleEntryDist<T>query1NN(double[] center)Finds the nearest neighbor.TqueryExact(double[] lower, double[] upper)Lookup an entry, using exact match.QueryIterator<RectangleEntry<T>>queryIntersect(double[] min, double[] max)QueryIteratorKNN<RectangleEntryDist<T>>queryKNN(double[] center, int k)Finds the nearest neighbor.Tremove(double[] lower, double[] upper)Remove an entry.Tupdate(double[] lo1, double[] up1, double[] lo2, double[] up2)Update the position of an entry.-
Methods inherited from interface org.tinspin.index.Index
clear, getDepth, getDims, getNodeCount, getStats, size, toStringTree
-
-
-
-
Method Detail
-
insert
void insert(double[] lower, double[] upper, T value)Insert a rectangle.- Parameters:
lower- minimum cornerupper- maximum cornervalue- value
-
remove
T remove(double[] lower, double[] upper)
Remove an entry.- Parameters:
lower- minimum cornerupper- maximum corner- Returns:
- the value of the entry or null if the entry was not found
-
update
T update(double[] lo1, double[] up1, double[] lo2, double[] up2)
Update the position of an entry.- Parameters:
lo1- old minup1- old maxlo2- new minup2- new max- Returns:
- the value, or null if the entries was not found
-
queryExact
T queryExact(double[] lower, double[] upper)
Lookup an entry, using exact match.- Parameters:
lower- minimum cornerupper- maximum corner- Returns:
- the value of the entry or null if the entry was not found
-
iterator
QueryIterator<RectangleEntry<T>> iterator()
- Returns:
- An iterator over all entries.
-
queryIntersect
QueryIterator<RectangleEntry<T>> queryIntersect(double[] min, double[] max)
- Parameters:
min- Lower left corner of the query windowmax- Upper right corner of the query window- Returns:
- All rectangles that intersect with the query rectangle.
-
query1NN
default RectangleEntryDist<T> query1NN(double[] center)
Finds the nearest neighbor. This uses euclidean 'edge distance'. Other distance types can only be specified directly on the index implementations.- Parameters:
center- center point- Returns:
- the nearest neighbor
-
queryKNN
QueryIteratorKNN<RectangleEntryDist<T>> queryKNN(double[] center, int k)
Finds the nearest neighbor. This uses euclidean 'edge distance', i.e. the distance to the edge of rectangle. Distance is 0 is the rectangle overlaps with the search point. Other distance types can only be specified directly on the index implementations.- Parameters:
center- center pointk- number of neighbors- Returns:
- list of nearest neighbors
-
-