infovis.tree
Class DepthFirst

java.lang.Object
  extended by infovis.tree.DepthFirst

public class DepthFirst
extends Object

Depth First traversal algorithm for trees.

Version:
$Revision: 1.9 $
Author:
Jean-Daniel Fekete

Nested Class Summary
static interface DepthFirst.Visitor
          Class for traversing a tree depth first.
 
Constructor Summary
DepthFirst()
           
 
Method Summary
static void visit(Tree tree, DepthFirst.Visitor visitor)
          Traverse the tree starting at a node with a depth first traversal, calling the visitor at each node.
static void visit(Tree tree, DepthFirst.Visitor visitor, int node)
          Traverse the tree starting at a node with a depth first traversal, calling the visitor at each node.
static void visitPreorder(Tree tree, IntProcedure visitor)
           
static void visitPreorder(Tree tree, IntProcedure visitor, int node)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepthFirst

public DepthFirst()
Method Detail

visit

public static void visit(Tree tree,
                         DepthFirst.Visitor visitor,
                         int node)
Traverse the tree starting at a node with a depth first traversal, calling the visitor at each node.

Parameters:
tree - the Tree
visitor - the DepthFirst,Visitor
node - the root node.

visitPreorder

public static void visitPreorder(Tree tree,
                                 IntProcedure visitor,
                                 int node)

visitPreorder

public static void visitPreorder(Tree tree,
                                 IntProcedure visitor)

visit

public static void visit(Tree tree,
                         DepthFirst.Visitor visitor)
Traverse the tree starting at a node with a depth first traversal, calling the visitor at each node.

Parameters:
tree - the Tree
visitor - the DepthFirst,Visitor


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.