com.bbn.openmap.geo
Interface ExtentIndex

All Superinterfaces:
java.util.Collection
All Known Implementing Classes:
ExtentIndex.AbstractExtentIndex

public interface ExtentIndex
extends java.util.Collection

A Collection of Regions that supports indexed subsets. That is, in addition to acting like a normal collection, it also allows getting an iterator that will return a superset of all intersecting regions that is a subset of the whole collection.

Author:
mthome@bbn.com

Nested Class Summary
static class ExtentIndex.AbstractExtentIndex
          A basic implementation of ExtentIndex that uses Collection-typed buckets.
static class ExtentIndex.ArrayListExtentIndexImpl
           
static class ExtentIndex.HashSetExtentIndexImpl
           
 
Method Summary
 boolean addExtent(GeoExtent region)
          Add a extent to the index.
 void clear()
          Resets the index to an empty state.
 double indexHorizontalRange()
          report on the maximum horizontalRange supported by this index.
 java.util.Iterator iterator(GeoExtent extent)
          return an iterator listing a subset of the whole collection that is a superset of the actual matches.
 boolean removeExtent(GeoExtent region)
          Remove a region from the index.
 
Methods inherited from interface java.util.Collection
add, addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

indexHorizontalRange

public double indexHorizontalRange()
report on the maximum horizontalRange supported by this index.


addExtent

public boolean addExtent(GeoExtent region)
Add a extent to the index.

Parameters:
region -
Returns:
true if Region successfully added, false if not.

removeExtent

public boolean removeExtent(GeoExtent region)
Remove a region from the index.

Parameters:
region -
Returns:
true if the region was found and removed.

clear

public void clear()
Resets the index to an empty state.

Specified by:
clear in interface java.util.Collection

iterator

public java.util.Iterator iterator(GeoExtent extent)
return an iterator listing a subset of the whole collection that is a superset of the actual matches. A valid (but inefficient) implementation would return an iterator over the whole collection. Implementation should match anything that is likely to match - this will generally include, for instance, additional space around the actual segment to accommodate buffer zones around the segment.



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