public interface HashTreeTraverser
addNode(Object,HashTree)
method is called. It is handed the object
at that node, and the entire sub-tree of the node.processPath()
method. It is the
traversing class's responsibility to know the path that has just finished
(this can be done by keeping a simple stack of all added nodes).subtractNode()
is
called. Again, it is the traverser's responsibility to know which node has
been retraced.processPath()
call is sent. As
the traversal backs up, nodes are subtracted.
The traversal is a depth-first traversal.
HashTree
,
SearchByClass
Modifier and Type | Method and Description |
---|---|
void |
addNode(Object node,
HashTree subTree)
The tree traverses itself depth-first, calling addNode for each object it
encounters as it goes.
|
void |
processPath()
Process path is called when a leaf is reached.
|
void |
subtractNode()
Indicates traversal has moved up a step, and the visitor should remove
the top node from its stack structure.
|
void addNode(Object node, HashTree subTree)
node
- the node currently encounteredsubTree
- the HashTree under the node encounteredvoid subtractNode()
void processPath()
subtractNode()
call. This is a callback method, and should
not be called except by a HashTree during traversal.Copyright © 1998-2016 Apache Software Foundation. All Rights Reserved.