|
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.TwoDTraversal
public abstract class TwoDTraversal
Defines a standard inorder traversal of the TwoDTree 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.
Constructor Summary | |
---|---|
protected |
TwoDTraversal()
Default constructor to properly enable subclasses to work. |
|
TwoDTraversal(TwoDTree tree)
Start traversal at the root. |
Method Summary | |
---|---|
void |
drain(TwoDNode node)
This drain is never invoked during the node-by-node traversal and it is implemented here to avoid subclasses from mistakenly thinking that they need to implement it. |
void |
traverse()
Control the traversal of the entire Tree. |
protected void |
traverse(TwoDNode node)
Traverse starting at this given node. |
abstract void |
visit(TwoDNode node)
Specialized behavior will be placed here (when visiting node). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TwoDTraversal()
public TwoDTraversal(TwoDTree tree)
tree
- Need to know the tree to process the traversal.Method Detail |
---|
protected void traverse(TwoDNode node)
node will never be null.
node
- public abstract void visit(TwoDNode node)
visit
in interface IVisitTwoDNode
node
- public final void drain(TwoDNode node)
drain
in interface IVisitTwoDNode
node
- Node to be drained, though this is never invoked during
the traversal.public void traverse()
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |