utils.index
Class Index

java.lang.Object
  extended byutils.index.Index

public abstract class Index
extends java.lang.Object

An abstract class for indexing objects in an area. A factory is provided to easily exchange the implementation.


Nested Class Summary
 class Index.Iterator
           
 
Constructor Summary
protected Index()
           
 
Method Summary
abstract  void add(Area area, java.lang.Object unit)
          add an object to the index.
protected  void add(java.lang.Object unit)
           
abstract  java.lang.Object get(Cartesian coordinates)
          get the first object of the index whose area covers the given point.
 Index.Iterator iterator()
           
static Index newIndex(WGS84 origin)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Index

protected Index()
Method Detail

newIndex

public static Index newIndex(WGS84 origin)

iterator

public Index.Iterator iterator()

add

public abstract void add(Area area,
                         java.lang.Object unit)
add an object to the index.

Parameters:
area - the area this object covers. This object is modified, so provide a copy if you need it untouched.
unit - the object itself

get

public abstract java.lang.Object get(Cartesian coordinates)
get the first object of the index whose area covers the given point.


add

protected void add(java.lang.Object unit)