edu.mit.sketch.geom
Class SpatialDatabase

java.lang.Object
  |
  +--edu.mit.sketch.geom.SpatialDatabase
All Implemented Interfaces:
Serializable

public class SpatialDatabase
extends Object
implements Serializable

This class will serve as data structure that keeps the positions of objects. It also supports some spatial queries.

See Also:
Serialized Form

Constructor Summary
SpatialDatabase()
          The constructor.
 
Method Summary
 void addPoint(Point point)
          Add a point
 Object[] getObjects(Rectangle focus)
          get the objects inside the focus rectangle.
 ArrayList pointsInside(int x1, int y1, int x2, int y2)
          get the points inside
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialDatabase

public SpatialDatabase()
The constructor.
Method Detail

addPoint

public void addPoint(Point point)
Add a point

pointsInside

public ArrayList pointsInside(int x1,
                              int y1,
                              int x2,
                              int y2)
get the points inside

getObjects

public Object[] getObjects(Rectangle focus)
get the objects inside the focus rectangle. This must be implemented to do the right thing.