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

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

java.lang.Object
  extended by org.deegree.io.quadtree.MemPointNode<T>
Type Parameters:
T - the datatype to be used as id
All Implemented Interfaces:
Node<T>

public class MemPointNode<T>
extends Object
implements Node<T>

MemPointNode is the node class of a memory based implementation of a quadtree.

Since:
2.0
Version:
2.0, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Constructor Summary
MemPointNode(Quadtree owner, Envelope env, int lvl)
          Constructs a new node with the given envelope, object, location and level.
 
Method Summary
 boolean delete(T item, Envelope env)
          Deletes the item from the quadtree.
 void deleteRange(Envelope envelope)
          Deletes all items intersecting the envelope.
 int getDepth()
           
 Envelope getEnvelope()
           
 String getId()
          This method does not make sense for the memory implementation.
 boolean insert(T item, Envelope itemEnv)
          Inserts the item into the quadtree.
 List<T> query(Envelope searchEnv, List<T> visitor, int level)
          Searches for all items intersecting the search envelope.
 boolean update(T item, 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

MemPointNode

public MemPointNode(Quadtree owner,
                    Envelope env,
                    int lvl)
Constructs a new node with the given envelope, object, location and level.

Parameters:
owner -
env - the envelope
lvl - the level
Method Detail

getDepth

public int getDepth()
Returns:
the deepest level of this subtree

getEnvelope

public Envelope getEnvelope()
Returns:
the region of this node

getId

public String getId()
This method does not make sense for the memory implementation.

Specified by:
getId in interface Node<T>
Returns:
null

insert

public boolean insert(T item,
                      Envelope itemEnv)
               throws IndexException
Inserts the item into the quadtree.

Specified by:
insert in interface Node<T>
Parameters:
item - the item
itemEnv - the envelope of the item
Returns:
true if the insertion occurred false otherwise.
Throws:
IndexException

query

public List<T> query(Envelope searchEnv,
                     List<T> visitor,
                     int level)
              throws IndexException
Searches for all items intersecting the search envelope.

Specified by:
query in interface Node<T>
Parameters:
searchEnv - the search envelope
visitor - the resulting list
level - unused by this implementation
Returns:
a list with all found items
Throws:
IndexException

delete

public boolean delete(T item,
                      Envelope env)
               throws IndexException
Deletes the item from the quadtree. Untested method!

Specified by:
delete in interface Node<T>
Parameters:
item - the item to be deleted
env - bbox of the item
Returns:
true if the deletion occurred false otherwise.
Throws:
IndexException

update

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

Specified by:
update in interface Node<T>
Parameters:
item - 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

deleteRange

public void deleteRange(Envelope envelope)
Deletes all items intersecting the envelope. Untested method!

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

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