com.vividsolutions.jts.index.bintree

Class Bintree


public class Bintree
extends java.lang.Object

An BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree. It indexes 1-dimensional intervals (which of course may be the projection of 2-D objects on an axis). It supports range searching (where the range may be a single point).

This implementation does not require specifying the extent of the inserted items beforehand. It will automatically expand to accomodate any extent of dataset.

This index is different to the Interval Tree of Edelsbrunner or the Segment Tree of Bentley.

Version:
1.6

Constructor Summary

Bintree()

Method Summary

int
depth()
static Interval
ensureExtent(Interval itemInterval, double minExtent)
Ensure that the Interval for the inserted item has non-zero extents.
void
insert(Interval itemInterval, Object item)
Iterator
iterator()
int
nodeSize()
Compute the total number of nodes in the tree
List
query(Interval interval)
min and max may be the same value
void
query(Interval interval, Collection foundItems)
List
query(double x)
int
size()

Constructor Details

Bintree

public Bintree()

Method Details

depth

public int depth()

ensureExtent

public static Interval ensureExtent(Interval itemInterval,
                                    double minExtent)
Ensure that the Interval for the inserted item has non-zero extents. Use the current minExtent to pad it, if necessary

insert

public void insert(Interval itemInterval,
                   Object item)

iterator

public Iterator iterator()

nodeSize

public int nodeSize()
Compute the total number of nodes in the tree
Returns:
the number of nodes in the tree

query

public List query(Interval interval)
min and max may be the same value

query

public void query(Interval interval,
                  Collection foundItems)

query

public List query(double x)

size

public int size()