T - the type of elements stored in this RTree.
public class GenericRTree<T> extends Objectimplements GenericSpatialIndex <T>, Externalizable
| Constructor and Description |
|---|
GenericRTree()
default constructor that initializes the underlying tree to have at least 1 and at most 10 childs per node.
|
GenericRTree(int minNodes, int maxNodes)
This constructor creates a GenericRTree.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Rectangle
Add
thing to this index with place-occupation specified by
r.
|
Set |
contains(Rectangle
Acquire a set of all elements contained in the given rectangle
r.
|
void |
contains(Rectangle
Calls
procedure on each element that is contained in the given rectangle
r.
|
boolean |
delete(Rectangle
Remove element
thing from spatial index.
|
Rectangle |
getBounds()
|
List |
intersectionsAsList(Rectangle
Acquire a list of all elements intersecting the given rectangle
r.
|
Set |
intersects(Rectangle
Acquire a set of all elements intersecting the given rectangle
r.
|
void |
intersects(Rectangle
Calls
procedure on each element that intersects the given rectangle
r.
|
Set |
nearest(Point
Acquire a set of all elements that are in less or equal distance of
p than
distance.
|
void |
nearest(Point
Execute
procedure on all elements that are in less or equal distance of
p than
distance.
|
void |
readExternal(ObjectInput
|
int |
size()
Returns the number of entries in this index.
|
void |
writeExternal(ObjectOutput
|
public GenericRTree(int minNodes,
int maxNodes)
minNodes - the minimum number of childs per node.
maxNodes - the maximum number of childs per node.
public GenericRTree()
public void add(Rectangler, T thing)
GenericSpatialIndex
thing to this index with place-occupation specified by
r.
add in interface
GenericSpatialIndex<T>
r - the element's bounding box
thing - the element to add.
public boolean delete(Rectangler, T thing)
GenericSpatialIndex
thing from spatial index. The associated rectangle
r has to be provided.
delete in interface
GenericSpatialIndex<T>
r - the element's bounding box.
thing - the element to remove.
public void contains(Rectangler, TObjectProcedure <T> procedure)
GenericSpatialIndex
procedure on each element that is contained in the given rectangle
r.
contains in interface
GenericSpatialIndex<T>
r - the rectangle to query for contained elements.
procedure - the procedure to call on each element.
public Set<T> contains(Rectangle r)
GenericSpatialIndex
r.
contains in interface
GenericSpatialIndex<T>
r - the rectangle to query for contained elements.
r.
public void intersects(Rectangler, TObjectProcedure <T> procedure)
GenericSpatialIndex
procedure on each element that intersects the given rectangle
r.
intersects in interface
GenericSpatialIndex<T>
r - the rectangle to query for intersecting elements.
procedure - the procedure to call on each element.
public Set<T> intersects(Rectangle r)
GenericSpatialIndex
r.
intersects in interface
GenericSpatialIndex<T>
r - the rectangle to query for intersecting elements.
r.
public List<T> intersectionsAsList(Rectangle r)
GenericSpatialIndex
r.
intersectionsAsList in interface
GenericSpatialIndex<T>
r - the rectangle to query for intersecting elements.
r
public void nearest(Pointp, TObjectProcedure <T> procedure, float distance)
GenericSpatialIndex
procedure on all elements that are in less or equal distance of
p than
distance.
nearest in interface
GenericSpatialIndex<T>
p - the point from where to measure distance.
procedure - the procedure to call on each element.
distance - the maximum distance from
p of elements.
public Set<T> nearest(Point p, float distance)
GenericSpatialIndex
p than
distance.
nearest in interface
GenericSpatialIndex<T>
p - the point from where to measure distance.
distance - the maximum distance from
p of elements.
distance.
public int size()
GenericSpatialIndex
size in interface
GenericSpatialIndex<T>
public RectanglegetBounds()
public void writeExternal(ObjectOutputoo) throws IOException
writeExternal in interface
Externalizable
IOException
public void readExternal(ObjectInputoi) throws IOException , ClassNotFoundException
readExternal in interface
Externalizable
IOException
ClassNotFoundException