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.
|Modifier and Type||Method and Description|
The tree traverses itself depth-first, calling addNode for each object it encounters as it goes.
Process path is called when a leaf is reached.
Indicates traversal has moved up a step, and the visitor should remove the top node from its stack structure.
node- the node currently encountered
subTree- the HashTree under the node encountered
subtractNode()call. This is a callback method, and should not be called except by a HashTree during traversal.
Copyright © 1998-2021 Apache Software Foundation. All Rights Reserved.