Class FilterTreeNode

java.lang.Object
  |
  +--FilterTreeNode

public class FilterTreeNode
extends java.lang.Object

Class FilterTreeNode is used for each node in a FilterTree.


Field Summary
 int botY
          The lowest Y value of the region corresponding to this node.
 int ID
          Each instance is given a unique ID for debugging purposes.
 boolean isLeaf
          Is this node a leaf?
 int leftX
          The leftmost X value of the rectangular region corresponding to this node.
 int level
          Which level is this node at?
 int midX
          The X value of the vertical bisector of the region corresponding to this node.
 int midY
          The Y value of the horizontal bisector of the region corresponding to this node.
 FilterTreeNode[] quadrants
          The list of (possibly four) children.
 java.util.LinkedList rectList
          The list of data rectangles stored at this node. Remember to cast when you access the list.
 int rightX
          The rightmost X value of the rectangular region corresponding to this node.
 int topY
          The largest Y value of the region corresponding to this node.
 
Constructor Summary
FilterTreeNode(int quadNum, FilterTreeNode node)
          An alternate constructor for internal use.
FilterTreeNode(int leftX, int rightX, int botY, int topY, int level)
          Creates a new FilterTreeNode instance, given (1) the extreme X values of the rectangular region, (2) the extreme Y values of the rectangular region, and (3) the level of the tree where this node will reside. The constructor computes the bisector values midX and midY.
 
Method Summary
 java.lang.String toString()
          Overrides Object's toString method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public int ID
Each instance is given a unique ID for debugging purposes.

level

public int level
Which level is this node at?

isLeaf

public boolean isLeaf
Is this node a leaf?

leftX

public int leftX
The leftmost X value of the rectangular region corresponding to this node.

rightX

public int rightX
The rightmost X value of the rectangular region corresponding to this node.

midX

public int midX
The X value of the vertical bisector of the region corresponding to this node.

botY

public int botY
The lowest Y value of the region corresponding to this node.

topY

public int topY
The largest Y value of the region corresponding to this node.

midY

public int midY
The Y value of the horizontal bisector of the region corresponding to this node.

quadrants

public FilterTreeNode[] quadrants
The list of (possibly four) children. Space for this array is created in the constructor.

rectList

public java.util.LinkedList rectList
The list of data rectangles stored at this node. This is simply an instance of java.util.LinkedList and is initialized in the constructor. Remember to cast when you access the list, for example, to retrieve from the list.
Constructor Detail

FilterTreeNode

public FilterTreeNode(int leftX,
                      int rightX,
                      int botY,
                      int topY,
                      int level)
Creates a new FilterTreeNode instance, given (1) the extreme X values of the rectangular region, (2) the extreme Y values of the rectangular region, and (3) the level of the tree where this node will reside. The constructor computes the horizontal (midY) and vertical (midX) bisectors, creates space for four child-pointers, and initializes the attached linked list.
Parameters:
leftX - an int value
rightX - an int value
botY - an int value
topY - an int value
level - an int value

FilterTreeNode

public FilterTreeNode(int quadNum,
                      FilterTreeNode node)
An alternate constructor for internal use.
Parameters:
quadNum - an int value
node - a FilterTreeNode value
Method Detail

toString

public java.lang.String toString()
Overrides Object's toString method.
Overrides:
toString in class java.lang.Object
Returns:
a String value