Tree iterator is a convinient and easy-to-use tree-traversing Java utility suitable for any kind of tree. It employs pre-order tree traversal algorithm (node is processed before its children).
Two things set the tree iterator apart from a
traditional way of traversing a treelike structure:
Adapters for DOM tree and
Swing (javax.swing.tree.TreeNode
) are provided with the iterator.
For example, it is possible to direct iterator to skip certain branches of a tree based on some criteria.
Or, alternatively, clients can dynamically change the depth of the traversal for different branches.
Tree iterator was featured in the “Generic tree traversal” article in the
November, 2000 issue of Doctor Dobb’s Journal.
Tree iterator is available under BSD license.