deegree 2.5 (2011/06/29 09:44 build-8-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 java.lang.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: 21181 $, 1.0. $Revision: 21181 $, $Date: 2009-12-02 16:47:53 +0100 (Mi, 02 Dez 2009) $
Author:
Andreas Poth, last edited by: $Author: aschmitz $

Constructor Summary
DBNode(java.lang.String id, DBQuadtree<T> qt, java.lang.String indexTable, JDBCConnection jdbc, int level, DBQuadtree.SupportedVersions version)
          A constructor which reads the envelope from the database.
DBNode(java.lang.String id, Envelope env, DBQuadtree<T> qt, java.lang.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()
           
 java.lang.String getId()
           
 boolean insert(T itemKey, Envelope itemEnv)
          inserts a new item into the quadtree
 java.util.List<T> query(Envelope searchEnv, java.util.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(java.lang.String id,
              Envelope env,
              DBQuadtree<T> qt,
              java.lang.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(java.lang.String id,
              DBQuadtree<T> qt,
              java.lang.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:
java.lang.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 java.util.List<T> query(Envelope searchEnv,
                               java.util.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 java.lang.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.5 (2011/06/29 09:44 build-8-official)

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