public class QuadTree extends Object
Constructor and Description |
---|
QuadTree()
Creates a quad tree with 0 capacity and depth.
|
QuadTree(int capacity,
int maxDepth)
Creates a quad tree.
|
Modifier and Type | Method and Description |
---|---|
int |
getCapacity()
Returns the capacity of node in the quad tree.
|
int |
getDepth()
Returns the maximum depth of the quad tree.
|
int |
getNodeSize()
Returns the node size of the quad tree.
|
int |
getSize()
Returns the size of the quad tree.
|
boolean |
insert(QuadTreeData data)
Inserts the specified data into the quad tree.
|
List<QuadTreeData> |
queryByBoundingBox(Envelope2D searchRegion)
Performs bounding box search.
|
List<QuadTreeData> |
queryByPointRadius(DirectPosition2D point,
double radiusKM)
Performs point radius search.
|
void |
setCapacity(int capacity)
Sets the capacity of node in the quad tree.
|
void |
setDepth(int depth)
Sets the maximum depth of the quad tree.
|
void |
setNodeSize(int nodeSize)
Sets the node size of the quad tree.
|
void |
setSize(int size)
Sets the size of the quad tree.
|
int |
size()
Returns the size of the quad tree.
|
public QuadTree(int capacity, int maxDepth)
capacity
- the capacity of each node in the quad treemaxDepth
- the maximum depth of the treepublic QuadTree()
public boolean insert(QuadTreeData data)
data
- specified data to be insertedpublic List<QuadTreeData> queryByPointRadius(DirectPosition2D point, double radiusKM)
point
- the center of the circular regionradiusKM
- the radius in kilometerspublic List<QuadTreeData> queryByBoundingBox(Envelope2D searchRegion)
searchRegion
- Envelope representing the rectangular search regionpublic int size()
public void setSize(int size)
size
- The new quad tree size.public int getSize()
public void setNodeSize(int nodeSize)
nodeSize
- The new node size.public int getNodeSize()
public int getCapacity()
public int getDepth()
public void setCapacity(int capacity)
capacity
- the capacity of node in the quad tree.public void setDepth(int depth)
depth
- the maximum depth of the quad tree.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.