A Generic Iterator for Tree Traversal
By Alexander Ananiev
, November 01, 2000
Generic tree traversal logic can be used with any type of tree-like structure or tree node, letting you focus on the application logic rather than the internals of the tree structure organization.
Nov00: Algorithm Alley
/** Returns enumeration of the children of the node. */
public Enumeration getChildren( Object node );
/** Returns true if node has children. */
public boolean hasChildren( Object node );
Example 2: Two methods are needed to implement an adapter for the tree iterator.