|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.util.quadtree.QuadTree
The QuadTree lets you organize objects in a grid, that redefines itself and focuses more gridding when more objects appear in a certain area.
Field Summary | |
protected QuadTreeNode |
top
|
Constructor Summary | |
QuadTree()
|
|
QuadTree(float north,
float west,
float south,
float east,
int maxItems)
|
|
QuadTree(float north,
float west,
float south,
float east,
int maxItems,
float minSize)
|
|
QuadTree(int up,
int left,
int down,
int right,
int maxItems)
|
Method Summary | |
void |
clear()
Clear the tree. |
java.lang.Object |
get(float lat,
float lon)
Get an object closest to a lat/lon. |
java.lang.Object |
get(float lat,
float lon,
double withinDistance)
Get an object closest to a lat/lon, within a maximum distance. |
java.util.Vector |
get(float north,
float west,
float south,
float east)
Get all the objects within a bounding box. |
java.util.Vector |
get(float north,
float west,
float south,
float east,
java.util.Vector vector)
Get all the objects within a bounding box, and return the objects within a given Vector. |
boolean |
put(float lat,
float lon,
java.lang.Object obj)
Add a object into the tree at a location. |
java.lang.Object |
remove(float lat,
float lon,
java.lang.Object obj)
Remove a object out of the tree at a location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected QuadTreeNode top
Constructor Detail |
public QuadTree()
public QuadTree(float north, float west, float south, float east, int maxItems)
public QuadTree(int up, int left, int down, int right, int maxItems)
public QuadTree(float north, float west, float south, float east, int maxItems, float minSize)
Method Detail |
public boolean put(float lat, float lon, java.lang.Object obj)
put
in interface DataOrganizer
lat
- up-down location in QuadTree Grid (latitude, y)lon
- left-right location in QuadTree Grid (longitude, x)
public java.lang.Object remove(float lat, float lon, java.lang.Object obj)
remove
in interface DataOrganizer
lat
- up-down location in QuadTree Grid (latitude, y)lon
- left-right location in QuadTree Grid (longitude, x)
public void clear()
clear
in interface DataOrganizer
public java.lang.Object get(float lat, float lon)
get
in interface DataOrganizer
lat
- up-down location in QuadTree Grid (latitude, y)lon
- left-right location in QuadTree Grid (longitude, x)
public java.lang.Object get(float lat, float lon, double withinDistance)
get
in interface DataOrganizer
lat
- up-down location in QuadTree Grid (latitude, y)lon
- left-right location in QuadTree Grid (longitude, x)withinDistance
- the maximum distance to get a hit, in
decimal degrees.
public java.util.Vector get(float north, float west, float south, float east)
get
in interface DataOrganizer
north
- top location in QuadTree Grid (latitude, y)west
- left location in QuadTree Grid (longitude, x)south
- lower location in QuadTree Grid (latitude, y)east
- right location in QuadTree Grid (longitude, x)
public java.util.Vector get(float north, float west, float south, float east, java.util.Vector vector)
north
- top location in QuadTree Grid (latitude, y)west
- left location in QuadTree Grid (longitude, x)south
- lower location in QuadTree Grid (latitude, y)east
- right location in QuadTree Grid (longitude, x)vector
- a vector to add objects to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |