org.jhotdraw.geom
Class QuadTree.QuadNode

java.lang.Object
  extended by org.jhotdraw.geom.QuadTree.QuadNode
Enclosing class:
QuadTree<T>

private class QuadTree.QuadNode
extends java.lang.Object


Field Summary
private  java.awt.geom.Rectangle2D.Double bounds
           
private  QuadTree.QuadNode northEast
           
private  QuadTree.QuadNode northWest
           
private  java.util.HashMap<T,java.awt.geom.Rectangle2D.Double> objects
          We store an object into this map, if 1) the bounds of the object contain our bounds or 2) we are a leaf.
private  QuadTree.QuadNode southEast
           
private  QuadTree.QuadNode southWest
           
 
Constructor Summary
QuadTree.QuadNode(java.awt.geom.Rectangle2D.Double bounds)
           
 
Method Summary
 void add(T o, java.awt.geom.Rectangle2D.Double oBounds)
           
 void findContains(java.awt.geom.Point2D.Double p, java.util.HashSet<T> result)
           
 void findInside(java.awt.geom.Rectangle2D.Double r, java.util.HashSet<T> result)
           
 void findIntersects(java.awt.geom.Rectangle2D.Double r, java.util.HashSet<T> result)
           
 boolean isLeaf()
           
 void join()
           
 void remove(T o)
           
 void split()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

private java.awt.geom.Rectangle2D.Double bounds

objects

private java.util.HashMap<T,java.awt.geom.Rectangle2D.Double> objects
We store an object into this map, if 1) the bounds of the object contain our bounds or 2) we are a leaf. key = Object value = Rectangle2D.Double


northEast

private QuadTree.QuadNode northEast

northWest

private QuadTree.QuadNode northWest

southEast

private QuadTree.QuadNode southEast

southWest

private QuadTree.QuadNode southWest
Constructor Detail

QuadTree.QuadNode

public QuadTree.QuadNode(java.awt.geom.Rectangle2D.Double bounds)
Method Detail

isLeaf

public boolean isLeaf()

remove

public void remove(T o)

add

public void add(T o,
                java.awt.geom.Rectangle2D.Double oBounds)

split

public void split()

join

public void join()

findContains

public void findContains(java.awt.geom.Point2D.Double p,
                         java.util.HashSet<T> result)

findIntersects

public void findIntersects(java.awt.geom.Rectangle2D.Double r,
                           java.util.HashSet<T> result)

findInside

public void findInside(java.awt.geom.Rectangle2D.Double r,
                       java.util.HashSet<T> result)