com.bbn.openmap.util
Interface DataOrganizer<T>

All Known Implementing Classes:
QuadTree

public interface DataOrganizer<T>

The DataOrganizer lets you organize objects in a way that will let you retrieve them based on a geographic query. It's an interface that lets you decide, with an implementation, the best way to manage and retrieve your data.


Method Summary
 void clear()
          Clear the organizer.
 T get(double lat, double lon)
          Find an object closest to a lat/lon.
 T get(double lat, double lon, double withinDistance)
          Find an object closest to a lat/lon, within a given maximum.
 java.util.Collection<T> get(double north, double west, double south, double east)
          Find all the objects within a bounding box.
 boolean put(double lat, double lon, T obj)
          Add a object into the organizer at a location.
 T remove(double lat, double lon, T obj)
          Remove a object out of the organizer at a location.
 

Method Detail

put

boolean put(double lat,
            double lon,
            T obj)
Add a object into the organizer at a location.

Parameters:
lat - up-down location (latitude, y)
lon - left-right location (longitude, x)
obj - object to add
Returns:
true if the insertion worked.

remove

T remove(double lat,
         double lon,
         T obj)
Remove a object out of the organizer at a location.

Parameters:
lat - up-down location (latitude, y)
lon - left-right location (longitude, x)
obj - object to remove
Returns:
the object removed, null if the object not found.

clear

void clear()
Clear the organizer.


get

T get(double lat,
      double lon)
Find an object closest to a lat/lon.

Parameters:
lat - up-down location in QuadTree Grid (latitude, y)
lon - left-right location in QuadTree Grid (longitude, x)
Returns:
the object that is closest to the lat/lon.

get

T get(double lat,
      double lon,
      double withinDistance)
Find an object closest to a lat/lon, within a given maximum.

Parameters:
lat - up-down location in QuadTree Grid (latitude, y)
lon - left-right location in QuadTree Grid (longitude, x)
withinDistance - maximum distance to have a hit.
Returns:
the object that is closest to the lat/lon, within the given distance.

get

java.util.Collection<T> get(double north,
                            double west,
                            double south,
                            double east)
Find all the objects within a bounding box.

Parameters:
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)
Returns:
Vector of objects.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details