Interface NodeDescendants.Visitor

Enclosing class:
NodeDescendants

public static interface NodeDescendants.Visitor
The Visitor processes a single node in a tree. This allows an object to visit each of the nodes in a tree.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Visit a node in a tree.
  • Method Details

    • visitNode

      Object visitNode(Node n)
      Visit a node in a tree. If the object doing the visiting wishes to stop the traversal early, it should return non-null. Otherwise it should return null.
      Parameters:
      n - the node being visited
      Returns:
      null if the traversal is to continue after this node; non-null if it is to stop