public class PriorityRTreeIndex extends HashMapIndex
HashMapIndex for queries
by region name and a priority R-tree for spatial queries.
At the moment, the R-tree is only utilized for the
applyContaining(Vector, Predicate) method, and the underlying
hash map-based index is used for the other spatial queries. In addition,
every modification to the index requires the entire R-tree to be rebuilt,
although this operation is reasonably quick.
This implementation is as thread-safe as the underlying
HashMapIndex, although spatial queries may lag behind changes
for very brief periods of time as the tree is rebuilt.
| Modifier and Type | Class and Description |
|---|---|
static class |
PriorityRTreeIndex.Factory
A factory for new instances using this index.
|
| Constructor and Description |
|---|
PriorityRTreeIndex() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyContaining(com.sk89q.worldedit.Vector position,
com.google.common.base.Predicate<ProtectedRegion> consumer)
Apply the given predicate to all regions that contain the given
position until there are no more regions or the predicate returns false.
|
void |
applyIntersecting(ProtectedRegion region,
com.google.common.base.Predicate<ProtectedRegion> consumer)
Apply the given predicate to all regions that intersect the given
region until there are no more regions or the predicate returns false.
|
protected void |
rebuildIndex()
Called to rebuild the index after changes.
|
protected void rebuildIndex()
HashMapIndexrebuildIndex in class HashMapIndexpublic void applyContaining(com.sk89q.worldedit.Vector position,
com.google.common.base.Predicate<ProtectedRegion> consumer)
RegionIndexapplyContaining in interface RegionIndexapplyContaining in class HashMapIndexposition - the positionconsumer - a predicate that returns true to continue iteratingpublic void applyIntersecting(ProtectedRegion region, com.google.common.base.Predicate<ProtectedRegion> consumer)
RegionIndexapplyIntersecting in interface RegionIndexapplyIntersecting in class HashMapIndexregion - the intersecting regionconsumer - a predicate that returns true to continue iteratingCopyright © 2015. All Rights Reserved.