public class SortedPackedIntervalRTree
extends java.lang.Object
This index structure is static - items cannot be added or removed once the first query has been made. The advantage of this characteristic is that the index performance can be optimized based on a fixed set of items.
Modifier and Type | Field and Description |
---|---|
private java.util.List |
leaves |
private int |
level |
private IntervalRTreeNode |
root |
Constructor and Description |
---|
SortedPackedIntervalRTree() |
Modifier and Type | Method and Description |
---|---|
private void |
buildLevel(java.util.List src,
java.util.List dest) |
private void |
buildRoot() |
private IntervalRTreeNode |
buildTree() |
private void |
init() |
void |
insert(double min,
double max,
java.lang.Object item)
Adds an item to the index which is associated with the given interval
|
private void |
printNode(IntervalRTreeNode node) |
void |
query(double min,
double max,
ItemVisitor visitor)
Search for intervals in the index which intersect the given closed interval
and apply the visitor to them.
|
private java.util.List leaves
private IntervalRTreeNode root
private int level
public void insert(double min, double max, java.lang.Object item)
min
- the lower bound of the item intervalmax
- the upper bound of the item intervalitem
- the item to insertjava.lang.IllegalStateException
- if the index has already been queriedprivate void init()
private void buildRoot()
private IntervalRTreeNode buildTree()
private void buildLevel(java.util.List src, java.util.List dest)
private void printNode(IntervalRTreeNode node)
public void query(double min, double max, ItemVisitor visitor)
min
- the lower bound of the query intervalmax
- the upper bound of the query intervalvisitor
- the visitor to pass any matched items to