spatial
Class BasicSpatialQuery

java.lang.Object
  |
  +--spatial.BasicSpatialQuery
All Implemented Interfaces:
SpatialQuery
Direct Known Subclasses:
AllQuery, ExactMatchQuery, IsContainedQuery, SelectQuery, WindowQuery

public abstract class BasicSpatialQuery
extends java.lang.Object
implements SpatialQuery

Class offering some basic operations required for spatial queries performed by a spatial search tree.


Field Summary
protected  int tolerance
          tolerance, required by some queries
 
Constructor Summary
BasicSpatialQuery()
           
 
Method Summary
 boolean areEqual(SpatialSearchTreeObject queryObj, SpatialSearchTreeObject storedObj)
          Tests whether the query object and the stored object are equal.
 boolean conditionFulfilled(MBR rect, MBR entryMBR)
          Tests whether the query rectangle and the MBR of a non-leaf entry intersect.
 boolean conditionFulfilled(MBR rect, SpatialSearchTreeEntry entry)
          Tests whether the query rectangle and the MBR of an leaf entry intersect.
 boolean conditionFulfilled(MBR rect, SpatialSearchTreeObject obj)
          Tests whether the query rectangle and the MBR of an object intersect.
 void setTolerance(int tolerance)
          Sets the tolerance attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tolerance

protected int tolerance
tolerance, required by some queries

Constructor Detail

BasicSpatialQuery

public BasicSpatialQuery()
Method Detail

areEqual

public boolean areEqual(SpatialSearchTreeObject queryObj,
                        SpatialSearchTreeObject storedObj)
Tests whether the query object and the stored object are equal.

Specified by:
areEqual in interface SpatialQuery
Parameters:
queryObj - the query object
storedObj - the stored object
Returns:
true if equal

conditionFulfilled

public boolean conditionFulfilled(MBR rect,
                                  MBR entryMBR)
Tests whether the query rectangle and the MBR of a non-leaf entry intersect. The tolerance attribute is considered.

Specified by:
conditionFulfilled in interface SpatialQuery
Parameters:
rect - the query rectangle
entryMBR - the minimum bounding rectangle of non-leaf entry
Returns:
true if the condition is fulfilled

conditionFulfilled

public boolean conditionFulfilled(MBR rect,
                                  SpatialSearchTreeEntry entry)
Tests whether the query rectangle and the MBR of an leaf entry intersect. The tolerance attribute is considered.

Specified by:
conditionFulfilled in interface SpatialQuery
Parameters:
rect - the query rectangle
entry - the entry of a leaf entry
Returns:
true if the condition is fulfilled

conditionFulfilled

public boolean conditionFulfilled(MBR rect,
                                  SpatialSearchTreeObject obj)
Tests whether the query rectangle and the MBR of an object intersect. The tolerance attribute is considered.

Specified by:
conditionFulfilled in interface SpatialQuery
Parameters:
rect - the query rectangle
obj - the object
Returns:
true if the condition fulfilled

setTolerance

public void setTolerance(int tolerance)
Sets the tolerance attribute.

Parameters:
tolerance - the new value of tolerance