|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.kdtree.KDTraversal
public abstract class KDTraversal
Defines a standard inorder traversal of the KDTree and enables subclasses to provide specialized method to take action at each node of the tree.
By referencing the tree, the traversal can be reused even when the tree is altered. Note, however, that altering the tree structure during a traversal will lead to non-determined behavior.
This traversal supports both traversals starting at the root, and those starting at arbitrary points in the hierarchy of the tree.
Constructor Summary | |
---|---|
protected |
KDTraversal()
Default constructor to properly enable subclasses to work. |
|
KDTraversal(KDTree tree)
Start traversal at the root. |
|
KDTraversal(KDTree tree,
DimensionalNode node)
Start traversal at the given node within the tree rooted at tree |
Method Summary | |
---|---|
void |
drain(DimensionalNode node)
During a regular traversal, drain is not invoked. |
void |
traverse()
Control the traversal of the entire Tree. |
abstract void |
visit(DimensionalNode node)
Specialized behavior will be placed here. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KDTraversal()
public KDTraversal(KDTree tree)
tree
- need the tree over which traversal executes.public KDTraversal(KDTree tree, DimensionalNode node)
tree
- need the tree over which traversal executes.node
- node within tree at which to begin the traversal.Method Detail |
---|
public abstract void visit(DimensionalNode node)
visit
in interface IVisitKDNode
node
- public final void drain(DimensionalNode node)
drain
in interface IVisitKDNode
public void traverse()
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |