Algorithm
Development Kit 1.0

algs.model.kdtree
Class CounterKDTree

java.lang.Object
  extended by algs.model.kdtree.CounterKDTree
All Implemented Interfaces:
IVisitKDNode

public class CounterKDTree
extends java.lang.Object
implements IVisitKDNode

Helper class to simply keep track of the number of selected nodes that are visited by a traversal.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Constructor Summary
CounterKDTree()
           
 
Method Summary
 void drain(DimensionalNode node)
          Specialized behavior during search traversals when an entire sub-tree is visited.
 int getCount()
          Retrieve the counter value.
 void reset()
          Reset the counter.
 void visit(DimensionalNode node)
          Specialized behavior during traversals for each node being visited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterKDTree

public CounterKDTree()
Method Detail

drain

public void drain(DimensionalNode node)
Description copied from interface: IVisitKDNode
Specialized behavior during search traversals when an entire sub-tree is visited. Typical behavior of this implementation is to immediately call visit() and then perform other computations done only when a node is drained.

Specified by:
drain in interface IVisitKDNode

visit

public void visit(DimensionalNode node)
Description copied from interface: IVisitKDNode
Specialized behavior during traversals for each node being visited.

Specified by:
visit in interface IVisitKDNode
Parameters:
node - the node being visited.

reset

public void reset()
Reset the counter.


getCount

public int getCount()
Retrieve the counter value.


Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.