T
- the type of entry to store in this RTree.public final class RTree<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RTree.SeedPicker |
Constructor and Description |
---|
RTree()
Builds a new RTree using default parameters: maximum 50 entries per node
minimum 2 entries per node 2 dimensions
|
RTree(int numDimensions) |
RTree(int maxEntries,
int minEntries,
int numDims) |
RTree(int maxEntries,
int minEntries,
int numDims,
RTree.SeedPicker seedPicker)
Creates a new RTree.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empties the RTree
|
boolean |
delete(float[] coords,
float[] dimensions,
T entry)
Deletes the entry associated with the given rectangle from the RTree
|
boolean |
delete(float[] coords,
T entry) |
int |
getMaxEntries() |
int |
getMinEntries() |
int |
getNumDims() |
void |
insert(float[] coords,
float[] dimensions,
T entry)
Inserts the given entry into the RTree, associated with the given
rectangle.
|
void |
insert(float[] coords,
T entry)
Convenience method for inserting a point
|
List<T> |
search(float[] coords,
float[] dimensions)
Searches the RTree for objects overlapping with the given rectangle.
|
int |
size() |
String |
visualize() |
public RTree(int maxEntries, int minEntries, int numDims, RTree.SeedPicker seedPicker)
maxEntries
- maximum number of entries per nodeminEntries
- minimum number of entries per node (except for the root
node)numDims
- the number of dimensions of the RTree.public RTree(int maxEntries, int minEntries, int numDims)
public RTree()
public RTree(int numDimensions)
public int getMaxEntries()
public int getMinEntries()
public int getNumDims()
public int size()
@Nonnull public List<T> search(float[] coords, float[] dimensions)
coords
- the corner of the rectangle that is the lower bound of
every dimension (eg. the top-left corner)dimensions
- the dimensions of the rectangle.public boolean delete(float[] coords, float[] dimensions, T entry)
coords
- the corner of the rectangle that is the lower bound in
every dimensiondimensions
- the dimensions of the rectangleentry
- the entry to deletepublic boolean delete(float[] coords, T entry)
public void clear()
public void insert(float[] coords, float[] dimensions, T entry)
coords
- the corner of the rectangle that is the lower bound in
every dimensiondimensions
- the dimensions of the rectangleentry
- the entry to insertpublic void insert(float[] coords, T entry)
coords
- entry
- public String visualize()
Copyright © 2014. All rights reserved.