public abstract class AbstractSTRtree extends Objectimplements Serializable
This implementation is based on Boundables rather than AbstractNodes, because the STR algorithm operates on both nodes and data, both of which are treated as Boundables.
STRtree,
SIRtree,
Serialized Form
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
AbstractSTRtree
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have different implementations of bounds.
|
| Modifier and Type | Field and Description |
|---|---|
protected AbstractNode |
root
|
| Constructor and Description |
|---|
AbstractSTRtree()
Constructs an AbstractSTRtree with the default node capacity.
|
AbstractSTRtree(int nodeCapacity)
Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have
|
| Modifier and Type | Method and Description |
|---|---|
protected List |
boundablesAtLevel(int level)
|
void |
build()
Creates parent nodes, grandparent nodes, and so forth up to the root node, for the data that has been inserted into the tree.
|
protected static int |
compareDoubles(double a, double b)
|
protected abstract AbstractNode |
createNode(int level)
|
protected List |
createParentBoundables(List
Sorts the childBoundables then divides them into groups of size M, where M is the node capacity.
|
protected int |
depth()
|
protected int |
depth(AbstractNode
|
protected abstract Comparator |
getComparator()
|
protected abstract AbstractSTRtree |
getIntersectsOp()
|
int |
getNodeCapacity()
Returns the maximum number of child nodes that a node may have
|
AbstractNode |
getRoot()
|
protected void |
insert(Object
|
boolean |
isEmpty()
Tests whether the index contains any items.
|
List |
itemsTree()
Gets a tree structure (as a nested list) corresponding to the structure of the items and nodes in this tree.
|
protected AbstractNode |
lastNode(List
|
protected List |
query(Object
Also builds the tree, if necessary.
|
protected void |
query(Object
Also builds the tree, if necessary.
|
protected boolean |
remove(Object
Removes an item from the tree.
|
protected int |
size()
|
protected int |
size(AbstractNode
|
protected AbstractNoderoot
public AbstractSTRtree()
public AbstractSTRtree(int nodeCapacity)
nodeCapacity - the maximum number of child nodes in a node
public void build()
protected abstract AbstractNodecreateNode(int level)
protected ListcreateParentBoundables(List childBoundables, int newLevel)
protected AbstractNodelastNode(List nodes)
protected static int compareDoubles(double a,
double b)public AbstractNodegetRoot()
public int getNodeCapacity()
public boolean isEmpty()
protected int size()
protected int size(AbstractNodenode)
protected int depth()
protected int depth(AbstractNodenode)
protected void query(ObjectsearchBounds, ItemVisitor visitor)
protected abstract AbstractSTRtree.IntersectsOp getIntersectsOp()
AbstractSTRtree.IntersectsOp
public ListitemsTree()
The returned Lists contain either Object items, or Lists which correspond to subtrees of the tree Subtrees which do not contain any items are not included.
Builds the tree if necessary.
protected boolean remove(ObjectsearchBounds, Object item)
protected ListboundablesAtLevel(int level)
protected abstract ComparatorgetComparator()