annas.graph.util.traversal
Class DepthFirst<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.util.traversal.DepthFirst<N,A>
Type Parameters:
N - Node type
A - Arc type

public class DepthFirst<N,A extends ArcInterface<N>>
extends java.lang.Object

Performs a depth first traversal

Author:
Sam Wilson

Constructor Summary
DepthFirst()
           
DepthFirst(GraphInterface<N,A> g)
           
 
Method Summary
 GraphInterface<N,A> getG()
           
 java.util.Iterator<N> run(N s)
          Performs a Depth first traversal on the graph from the source node
 java.util.Iterator<N> run(N s, N tar)
          Performs a Depth first traversal on the graph from the source node to the destination node
 void setG(GraphInterface<N,A> g)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepthFirst

public DepthFirst()

DepthFirst

public DepthFirst(GraphInterface<N,A> g)
Method Detail

run

public java.util.Iterator<N> run(N s)
Performs a Depth first traversal on the graph from the source node

Parameters:
s - Source node
Returns:
Iterator of the traversal

run

public java.util.Iterator<N> run(N s,
                                 N tar)
Performs a Depth first traversal on the graph from the source node to the destination node

Parameters:
s - Source node
tar - destination node
Returns:
Iterator of the traversal

getG

public GraphInterface<N,A> getG()

setG

public void setG(GraphInterface<N,A> g)