T
- the type of the elements to be saved in this index.public interface GenericSpatialIndex<T>
Modifier and Type | Method and Description |
---|---|
void |
add(Rectangle r,
T thing)
Add
thing to this index with place-occupation specified by
r . |
Set<T> |
contains(Rectangle r)
Acquire a set of all elements contained in the given rectangle
r . |
void |
contains(Rectangle r,
TObjectProcedure<T> procedure)
Calls
procedure on each element that is contained in the
given rectangle r . |
boolean |
delete(Rectangle r,
T thing)
Remove element
thing from spatial index. |
List<T> |
intersectionsAsList(Rectangle r)
Acquire a list of all elements intersecting the given rectangle
r . |
Set<T> |
intersects(Rectangle r)
Acquire a set of all elements intersecting the given rectangle
r . |
void |
intersects(Rectangle r,
TObjectProcedure<T> procedure)
Calls
procedure on each element that intersects the given
rectangle r . |
Set<T> |
nearest(Point p,
float distance)
Acquire a set of all elements that are in less or equal distance of
p than distance . |
void |
nearest(Point p,
TObjectProcedure<T> procedure,
float distance)
Execute
procedure on all elements that are in less or equal
distance of p than distance . |
int |
size()
Returns the number of entries in this index.
|
void add(Rectangle r, T thing)
thing
to this index with place-occupation specified by
r
.r
- the element's bounding boxthing
- the element to add.void contains(Rectangle r, TObjectProcedure<T> procedure)
procedure
on each element that is contained in the
given rectangle r
.r
- the rectangle to query for contained elements.procedure
- the procedure to call on each element.Set<T> contains(Rectangle r)
r
.r
- the rectangle to query for contained elements.r
.boolean delete(Rectangle r, T thing)
thing
from spatial index. The associated
rectangle r
has to be provided.r
- the element's bounding box.thing
- the element to remove.void intersects(Rectangle r, TObjectProcedure<T> procedure)
procedure
on each element that intersects the given
rectangle r
.r
- the rectangle to query for intersecting elements.procedure
- the procedure to call on each element.Set<T> intersects(Rectangle r)
r
.r
- the rectangle to query for intersecting elements.r
.List<T> intersectionsAsList(Rectangle r)
r
.r
- the rectangle to query for intersecting elements.r
void nearest(Point p, TObjectProcedure<T> procedure, float distance)
procedure
on all elements that are in less or equal
distance of p
than distance
.p
- the point from where to measure distance.procedure
- the procedure to call on each element.distance
- the maximum distance from p
of elements.Set<T> nearest(Point p, float distance)
p
than distance
.p
- the point from where to measure distance.distance
- the maximum distance from p
of elements.distance
.int size()