agl2.alg
Class DepthFirstSearch

java.lang.Object
  |
  +--agl2.alg.DepthFirstSearch

public class DepthFirstSearch
extends java.lang.Object

Perform DepthFirstSearch on a graph.


Constructor Summary
DepthFirstSearch(VertexGraph g)
           
DepthFirstSearch(VertexGraph g, GraphVisitor v)
          Initialize the depth first of the vertex graph
 
Method Summary
 void apply(java.lang.Object root)
          Apply the alorithm begining at root
 void apply(java.lang.Object root, GraphVisitor v)
           
static java.util.Iterator nodeIterator(VertexGraph g, java.lang.Object root)
           
static java.util.Iterator nodeReverseIterator(VertexGraph g, java.lang.Object root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepthFirstSearch

public DepthFirstSearch(VertexGraph g,
                        GraphVisitor v)
Initialize the depth first of the vertex graph

Parameters:
g - a graph
v - a visitor

DepthFirstSearch

public DepthFirstSearch(VertexGraph g)
Method Detail

apply

public void apply(java.lang.Object root,
                  GraphVisitor v)

apply

public void apply(java.lang.Object root)
Apply the alorithm begining at root

Parameters:
root - The root node (or null)

nodeIterator

public static java.util.Iterator nodeIterator(VertexGraph g,
                                              java.lang.Object root)

nodeReverseIterator

public static java.util.Iterator nodeReverseIterator(VertexGraph g,
                                                     java.lang.Object root)