|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.graph.algorithm.GraphTraversal
public abstract class GraphTraversal
Abstract class for an algorithm implementing graph traversal. Classes implementing the Graph interface uses the Strategy pattern to allow different implementations of the graph traversal algorithm to be used. Concrete implementations of this class must never modify the Graph itself.
Field Summary | |
---|---|
(package private) Graph |
graph
The Graph on which graph traversal will be performed. |
static int |
OK
|
static int |
TERMINATEDBYVISITOR
|
Constructor Summary | |
---|---|
GraphTraversal(Graph graph)
|
Method Summary | |
---|---|
abstract java.util.Vector |
traverse(Vertex startat)
Abstract traversal method to be implemented by subclasses. |
abstract int |
traverse(Vertex startat,
java.util.Vector visited,
Visitor visitor)
Abstract traversal method to be implemented by subclasses. |
abstract java.util.Vector |
traverse(Vertex startat,
Visitor visitor)
Abstract traversal method to be implemented by subclasses. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TERMINATEDBYVISITOR
public static final int OK
Graph graph
Constructor Detail |
---|
public GraphTraversal(Graph graph)
Method Detail |
---|
public abstract int traverse(Vertex startat, java.util.Vector visited, Visitor visitor)
startat
- The vertex from which traversal will start.visitor
- Visitor object controlling if and when traversal will stop,
apart from having visited all the vertices.visited
- A Vector of vertices that has been visited in sequence by the traversalpublic abstract java.util.Vector traverse(Vertex startat)
startat
- The vertex from which traversal will start.
public abstract java.util.Vector traverse(Vertex startat, Visitor visitor)
startat
- The vertex from which traversal will start.visitor
- Visitor object controlling if and when traversal will stop,
apart from having visited all the vertices.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |