public abstract class AbstractSTRtree extends Object implements 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.
This class is thread-safe. Building the tree is synchronized, and querying is stateless.
STRtree,
SIRtree,
Serialized Form| 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
|
AbstractSTRtree(int nodeCapacity,
AbstractNode root)
Constructs an AbstractSTRtree with the specified maximum number of child
nodes that a node may have, and the root node
|
AbstractSTRtree(int nodeCapacity,
ArrayList itemBoundables)
Constructs an AbstractSTRtree with the specified maximum number of child
nodes that a node may have, and all leaf nodes in the tree
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getNodeCapacity()
Returns the maximum number of child nodes that a node may have.
|
AbstractNode |
getRoot()
Gets the root node of the tree.
|
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.
|
public AbstractSTRtree()
public AbstractSTRtree(int nodeCapacity)
nodeCapacity - the maximum number of child nodes in a nodepublic AbstractSTRtree(int nodeCapacity,
AbstractNode root)
nodeCapacity - the maximum number of child nodes in a noderoot - the root node that links to all other nodes in the treepublic AbstractSTRtree(int nodeCapacity,
ArrayList itemBoundables)
nodeCapacity - the maximum number of child nodes in a nodeitemBoundables - the list of leaf nodes in the treepublic void build()
public AbstractNode getRoot()
public int getNodeCapacity()
public boolean isEmpty()
public List itemsTree()
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.
Copyright © 2024. All rights reserved.