spatial
Class RegionQuery

java.lang.Object
  |
  +--index.Query
        |
        +--spatial.RegionQuery
All Implemented Interfaces:
SpatialSearchTreeQuery

public class RegionQuery
extends Query
implements SpatialSearchTreeQuery

A general region query for search trees


Field Summary
protected  int[] index
          The current path: search indices for the different heights of the tree.
protected static int MAXHEIGHT
          The maximum height of the tree.
protected  SpatialSearchTreeNode[] node
          The current path: nodes from different heights of the tree.
protected  int operation
          The query mode.
protected  int pathLength
          The length of the current path.
protected  SpatialQuery query
          The current query.
protected  SpatialSearchTreeObject queryObj
          The current query object, may be null.
protected  MBR rect
          The current query rectangle.
 
Fields inherited from class index.Query
ALLLAYERS, ALLSCALES, QUERY, queryNum, REMOVEALL, REMOVEEXACT, resultNum, timer, UPDATEALL, UPDATEEXACT
 
Constructor Summary
RegionQuery(SpatialQuery query)
          Region query constructor.
 
Method Summary
 SpatialSearchTreeObject getNextObject()
          Returns the next object fulfilling the query condition.
protected  SpatialSearchTreeObject getNextObject(int actHeight)
          Returns (or removes or moves) the next object(s) fulfilling the query condition.
 SpatialQuery getQuery()
          Return the spatial query.
 void init(SpatialSearchTree tree)
          Initializes a query without spatial conditions.
 void init(SpatialSearchTree tree, int operation)
          Initializes a query without spatial conditions.
 void initWithObject(SpatialSearchTree tree, SpatialSearchTreeObject queryObj)
          Initializes a new query.
 void initWithObject(SpatialSearchTree tree, SpatialSearchTreeObject queryObj, int operation)
          Initializes a new query.
 void initWithPoint(SpatialSearchTree tree, int[] point)
          Initializes a new query.
 void initWithPoint(SpatialSearchTree tree, int[] point, int operation)
          Initializes a new query.
 void initWithRect(SpatialSearchTree tree, MBR window)
          Initializes a new query.
 void initWithRect(SpatialSearchTree tree, MBR window, int operation)
          Initializes a new query.
 void reset()
          Resets the query.
 void resetLocks()
          Resets all locks except of the root node.
 
Methods inherited from class index.Query
getQueryNum, getQueryTime, getResultNum, resetCounters, setCounters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface spatial.SpatialSearchTreeQuery
getQueryNum, getQueryTime, getResultNum, resetCounters
 

Field Detail

query

protected SpatialQuery query
The current query.


queryObj

protected SpatialSearchTreeObject queryObj
The current query object, may be null.


rect

protected MBR rect
The current query rectangle.


operation

protected int operation
The query mode.


MAXHEIGHT

protected static final int MAXHEIGHT
The maximum height of the tree.

See Also:
Constant Field Values

node

protected SpatialSearchTreeNode[] node
The current path: nodes from different heights of the tree.


index

protected int[] index
The current path: search indices for the different heights of the tree.


pathLength

protected int pathLength
The length of the current path.

Constructor Detail

RegionQuery

public RegionQuery(SpatialQuery query)
Region query constructor.

Parameters:
query - definition of the query
Method Detail

getNextObject

public SpatialSearchTreeObject getNextObject()
Returns the next object fulfilling the query condition. Will return null if no object is found.

Specified by:
getNextObject in interface SpatialSearchTreeQuery
Returns:
the found object

getNextObject

protected SpatialSearchTreeObject getNextObject(int actHeight)
Returns (or removes or moves) the next object(s) fulfilling the query condition. Will return null if no object is found.

Parameters:
actHeight - actual height
Returns:
the found object

getQuery

public SpatialQuery getQuery()
Return the spatial query.

Returns:
the spatial query

init

public void init(SpatialSearchTree tree)
Initializes a query without spatial conditions.

Specified by:
init in interface SpatialSearchTreeQuery
Parameters:
tree - the searchtree

init

public void init(SpatialSearchTree tree,
                 int operation)
Initializes a query without spatial conditions.

Parameters:
tree - the searchtree
operation - the operation

initWithPoint

public void initWithPoint(SpatialSearchTree tree,
                          int[] point)
Initializes a new query.

Parameters:
tree - the searchtree
point - coordinates of the query point

initWithPoint

public void initWithPoint(SpatialSearchTree tree,
                          int[] point,
                          int operation)
Initializes a new query.

Parameters:
tree - the searchtree
point - coordinates of the query point
operation - the query operation

initWithRect

public void initWithRect(SpatialSearchTree tree,
                         MBR window)
Initializes a new query.

Parameters:
tree - the searchtree
window - the query window

initWithRect

public void initWithRect(SpatialSearchTree tree,
                         MBR window,
                         int operation)
Initializes a new query.

Parameters:
tree - the searchtree
window - the query window
operation - the query operation

initWithObject

public void initWithObject(SpatialSearchTree tree,
                           SpatialSearchTreeObject queryObj)
Initializes a new query.

Parameters:
tree - the searchtree
queryObj - the query object

initWithObject

public void initWithObject(SpatialSearchTree tree,
                           SpatialSearchTreeObject queryObj,
                           int operation)
Initializes a new query.

Parameters:
tree - the searchtree
queryObj - the query object
operation - the query operation

reset

public void reset()
Resets the query.

Specified by:
reset in interface SpatialSearchTreeQuery

resetLocks

public void resetLocks()
Resets all locks except of the root node.