deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.quadtree
Class DBNode<T>

java.lang.Object
  extended by org.deegree.io.quadtree.DBNode<T>
All Implemented Interfaces:
Node<T>

 class DBNode<T>
extends Object
implements Node<T>

Represents a node of a DBQuadtree. Nodes contain items which have a spatial extent corresponding to the node's position in the quadtree.

Since:
2.0
Version:
$Revision: 21180 $, 1.0. $Revision: 21180 $, $Date: 2009-12-02 16:45:30 +0100 (Mi, 02. Dez 2009) $
Author:
Andreas Poth, last edited by: $Author: aschmitz $

Constructor Summary
DBNode(String id, DBQuadtree<T> qt, String indexTable, JDBCConnection jdbc, int level, DBQuadtree.SupportedVersions version)
          A constructor which reads the envelope from the database.
DBNode(String id, Envelope env, DBQuadtree<T> qt, String indexTable, JDBCConnection jdbc, int level, DBQuadtree.SupportedVersions version)
           
 
Method Summary
 boolean delete(T itemKey, Envelope itemEnv)
          deletes a specific item from the tree (not the item itself will be deleted, just its reference will be.
 void deleteRange(Envelope envelope)
          deletes all references of items whose envelope intersects with the passed one (
 Envelope getEnvelope()
           
 String getId()
           
 boolean insert(T itemKey, Envelope itemEnv)
          inserts a new item into the quadtree
 List<T> query(Envelope searchEnv, List<T> visitor, int currentLevel)
          returns a List containing all items whose envelope intersects with the passed one
 boolean update(T itemKey, Envelope newBBox)
          Updates the spatial reference of the given item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBNode

public DBNode(String id,
              Envelope env,
              DBQuadtree<T> qt,
              String indexTable,
              JDBCConnection jdbc,
              int level,
              DBQuadtree.SupportedVersions version)
       throws IndexException
Parameters:
id -
env -
qt -
indexTable -
jdbc -
level -
version - of the quadtree layout to use
Throws:
IndexException - if the node with given id could not be read from the db.

DBNode

public DBNode(String id,
              DBQuadtree<T> qt,
              String indexTable,
              JDBCConnection jdbc,
              int level,
              DBQuadtree.SupportedVersions version)
       throws IndexException
A constructor which reads the envelope from the database.

Parameters:
id -
qt -
indexTable -
jdbc -
level -
version - of the quadtree layout to use.
Throws:
IndexException - if the node with given id could not be read from the db.
Method Detail

insert

public boolean insert(T itemKey,
                      Envelope itemEnv)
               throws IndexException
Description copied from interface: Node
inserts a new item into the quadtree

Specified by:
insert in interface Node<T>
Parameters:
itemKey - (or it's id) which shall be inserted into the quadtree.
itemEnv - the bbox of the item
Returns:
true if the insertion occurred false otherwise.
Throws:
IndexException

deleteRange

public void deleteRange(Envelope envelope)
Description copied from interface: Node
deletes all references of items whose envelope intersects with the passed one (

Specified by:
deleteRange in interface Node<T>
See Also:
)

delete

public boolean delete(T itemKey,
                      Envelope itemEnv)
               throws IndexException
Description copied from interface: Node
deletes a specific item from the tree (not the item itself will be deleted, just its reference will be.

Specified by:
delete in interface Node<T>
Parameters:
itemKey - (or it's ide) to be deleted
itemEnv - bbox of the item
Returns:
true if the deletion occurred false otherwise.
Throws:
UnsupportedOperationException - if the version of this quadtree(node) is not 2.0.0 or higher.
IndexException

update

public boolean update(T itemKey,
                      Envelope newBBox)
Description copied from interface: Node
Updates the spatial reference of the given item.

Specified by:
update in interface Node<T>
Parameters:
itemKey - which spatial reference in the quadtree should be updated.
newBBox - newBBox the new BBoundingbox of the item.
Returns:
true if the update occurred, false otherwise

query

public List<T> query(Envelope searchEnv,
                     List<T> visitor,
                     int currentLevel)
              throws IndexException
Description copied from interface: Node
returns a List containing all items whose envelope intersects with the passed one

Specified by:
query in interface Node<T>
Returns:
a List containing all items whose envelope intersects with the passed one
Throws:
IndexException

getId

public String getId()
Specified by:
getId in interface Node<T>
Returns:
the id of the Node

getEnvelope

public Envelope getEnvelope()
Returns:
the envelope (bbox) of this dbNode.

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org