|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SpatialIndex
A generic contract for spatial indexes, such as quadtrees or r-trees. Provides methods to insert, delete and query the index. Note that implementations may be n-dimensional.
Field Summary | |
---|---|
static double |
EPSILON
This constant is used to check if two doubles are nearly equal. |
static java.lang.String |
INDEX_TYPE_PROPERTY
|
Method Summary | |
---|---|
void |
clear()
Empty the index. |
void |
containmentQuery(Shape query,
Visitor v)
Traverse index to match data such as : query.contains(Data.getShape()) |
void |
flush()
Cause pending write operations to happen immediately. |
java.util.Properties |
getIndexProperties()
|
Statistics |
getStatistics()
|
void |
initializeFromStorage(Storage storage)
Initializes the spatial index from a storage instance. |
void |
insertData(java.lang.Object data,
Shape shape)
Insert new data in the index. |
void |
intersectionQuery(Shape query,
Visitor v)
Traverse index to match data such as : query.intersects(Data.getShape()) |
boolean |
isIndexValid()
Implementations may always return true. |
void |
nearestNeighborQuery(int k,
Shape query,
Visitor v)
|
void |
nearestNeighborQuery(int k,
Shape query,
Visitor v,
NearestNeighborComparator nnc)
|
void |
pointLocationQuery(Point query,
Visitor v)
Traverse index to match data having query falling inside its shape, ie : Data.getShape().contains(query) |
Field Detail |
---|
static final java.lang.String INDEX_TYPE_PROPERTY
static final double EPSILON
Method Detail |
---|
void clear() throws java.lang.IllegalStateException
java.lang.IllegalStateException
void insertData(java.lang.Object data, Shape shape)
data
- to inserta
- n-dims shapevoid containmentQuery(Shape query, Visitor v)
query.contains(Data.getShape())
query,
- a n-dims shapevisitor
- implementing visit() callback methodvoid intersectionQuery(Shape query, Visitor v)
query.intersects(Data.getShape())
query,
- a n-dims shapevisitor
- implementing visit() callback methodvoid pointLocationQuery(Point query, Visitor v)
Data.getShape().contains(query)
query,
- a n-dims pointvisitor
- implementing visit() callback methodvoid nearestNeighborQuery(int k, Shape query, Visitor v, NearestNeighborComparator nnc)
k
- query
- v
- nnc
- void nearestNeighborQuery(int k, Shape query, Visitor v)
k
- query
- v
- java.util.Properties getIndexProperties()
boolean isIndexValid()
Statistics getStatistics()
void flush()
void initializeFromStorage(Storage storage)
This allows caches to be saved to storage and reused.
storage
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |