gov.nasa.worldwind.util
Class SpatialTree<S,T>
java.lang.Object
gov.nasa.worldwind.util.SpatialTree<S,T>
- Direct Known Subclasses:
- SpatialTree.LocationTree, SpatialTree.MarkerTree, SpatialTree.SectorTree
public abstract class SpatialTree<S,T>
- extends Object
|
Constructor Summary |
SpatialTree(S coverage,
int depth,
int maxDepth,
boolean addToAllLevels)
|
SpatialTree(S coverage,
int depth,
int maxDepth,
boolean addToAllLevels,
int rows,
int cols)
|
|
Method Summary |
boolean |
add(T item)
|
protected abstract boolean |
contains(S extent,
LatLon location)
|
protected abstract SpatialTree<S,T> |
createInstance(S extent,
int depth,
int maxDepth,
boolean addToAllLevels)
|
Collection<T> |
getAll(Collection<T> itemsOut)
|
S |
getCoverage()
|
int |
getDepth()
|
Collection<T> |
getItems(LatLon location,
int depth,
Collection<T> itemsOut)
|
Collection<T> |
getItems(S extent,
Collection<T> itemsOut)
|
int |
getMaxDepth()
|
protected abstract boolean |
intersects(S extent,
T item)
|
protected abstract boolean |
intersectsCoverage(S extent1,
S extent2)
|
protected boolean |
maxDepthAdd(T item)
|
protected boolean |
maxDepthRemove(T item)
|
protected boolean |
normalAdd(T item)
|
protected boolean |
normalRemove(Sector itemRegion,
T item)
|
boolean |
remove(Sector itemRegion,
T item)
|
protected abstract ArrayList<S> |
subdivide(S extent,
int rows,
int cols)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
addToAllLevels
protected boolean addToAllLevels
children
protected ArrayList<SpatialTree<S,T>> children
coverage
protected S coverage
depth
protected int depth
items
protected List<T> items
maxDepth
protected int maxDepth
subCoverage
protected List<S> subCoverage
SpatialTree
public SpatialTree(S coverage,
int depth,
int maxDepth,
boolean addToAllLevels)
SpatialTree
public SpatialTree(S coverage,
int depth,
int maxDepth,
boolean addToAllLevels,
int rows,
int cols)
add
public boolean add(T item)
contains
protected abstract boolean contains(S extent,
LatLon location)
createInstance
protected abstract SpatialTree<S,T> createInstance(S extent,
int depth,
int maxDepth,
boolean addToAllLevels)
getAll
public Collection<T> getAll(Collection<T> itemsOut)
getCoverage
public S getCoverage()
getDepth
public int getDepth()
getItems
public Collection<T> getItems(LatLon location,
int depth,
Collection<T> itemsOut)
getItems
public Collection<T> getItems(S extent,
Collection<T> itemsOut)
getMaxDepth
public int getMaxDepth()
intersects
protected abstract boolean intersects(S extent,
T item)
intersectsCoverage
protected abstract boolean intersectsCoverage(S extent1,
S extent2)
maxDepthAdd
protected boolean maxDepthAdd(T item)
maxDepthRemove
protected boolean maxDepthRemove(T item)
normalAdd
protected boolean normalAdd(T item)
normalRemove
protected boolean normalRemove(Sector itemRegion,
T item)
remove
public boolean remove(Sector itemRegion,
T item)
subdivide
protected abstract ArrayList<S> subdivide(S extent,
int rows,
int cols)