. Removing the "implements Constants" as it is a bad pattern. Interfaces

should represent types. It also makes the UML diagrams very hard
  to follow. We're just going to use the fully qualified GraphConstants.{x}
  idiom.

. Added the Graphable interface to allow any arbitrary object to be
  manipulated like a vertex in a graph.

. Added a util package that has a dependency resolver that uses a depth first
  search to sort the dependencies for a set of objects that implement
  the Graphable interface. The resolver also works with Strings and
  lists and deps stated as lists of strings so I can resuse the test
  I wrote for the DependencyEngine in jjar.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/graph/trunk@144586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jvanzyl committed 2001-12-02 18:07:19 +00:00
1 parent 41f1622c83
commit f3a7176baf
21 files changed
+590 -79

No files matched your search

@@ -56,7 +56,7 @@ package org.apache.commons.graph.visualize;
import java.io.OutputStream;
import org.apache.commons.graph.Constants;
import org.apache.commons.graph.GraphConstants;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
import org.apache.commons.graph.Sequential;
@@ -70,10 +70,10 @@ import org.apache.commons.graph.Vertex;
*
* Traverses graph with the Sequential visitor, since it uses invariants of that algorithm.
*
* @version $Id: DaVinciVisualizer.java,v 1.1 2001/11/29 14:24:23 jvanzyl Exp $
* @version $Id: DaVinciVisualizer.java,v 1.2 2001/12/02 18:07:18 jvanzyl Exp $
* @author <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
*/
public class DaVinciVisualizer extends GraphVisualizer implements Constants {
public class DaVinciVisualizer extends GraphVisualizer implements GraphConstants {
private Graph graph;
private int no_edges, edges;
private int no_vertices, vertices;
@@ -56,7 +56,7 @@ package org.apache.commons.graph.visualize;
import java.io.OutputStream;
import org.apache.commons.graph.Constants;
import org.apache.commons.graph.GraphConstants;
import org.apache.commons.graph.DFS;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
@@ -66,7 +66,7 @@ import org.apache.commons.graph.Vertex;
* Visualizes graphs into the <A HREF="http://www.fmi.uni-passau.de/Graphlet/">GML</A>
* format.
*
* @version $Id: GMLVisualizer.java,v 1.1 2001/11/29 14:24:23 jvanzyl Exp $
* @version $Id: GMLVisualizer.java,v 1.2 2001/12/02 18:07:18 jvanzyl Exp $
* @author <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
*/
public class GMLVisualizer extends GraphVisualizer {
@@ -56,7 +56,7 @@ package org.apache.commons.graph.visualize;
import java.io.OutputStream;
import org.apache.commons.graph.Constants;
import org.apache.commons.graph.GraphConstants;
import org.apache.commons.graph.DFS;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
@@ -66,7 +66,7 @@ import org.apache.commons.graph.Vertex;
* Visualizes graphs into the <A HREF="http://www.fmi.uni-passau.de/Graphlet/">GML</A>
* format.
*
* @version $Id: GraphMLVisualizer.java,v 1.1 2001/11/29 21:12:40 jvanzyl Exp $
* @version $Id: GraphMLVisualizer.java,v 1.2 2001/12/02 18:07:18 jvanzyl Exp $
* @author <a href="mailto:jvanzyl@zenplex.com">Jason van Zyl</a>
*/
public class GraphMLVisualizer
@@ -100,15 +100,15 @@ public class GraphMLVisualizer
public void discoverVertex(Vertex v)
{
println(0, "<node name=\"" + v.getIdent() + "\"/>");
println(0, "<node name=\"" + v + "\"/>");
}
public void finishVertex(Vertex v) {}
public void discoverEdge(Edge e)
{
int src = graph.getSource(e).getIdent();
int target = graph.getTarget(e).getIdent();
String src = graph.getSource(e).toString();
String target = graph.getTarget(e).toString();
println(0, "<edge source=\"" + src + "\" target=\"" + target + "\"/>");
}
@@ -56,7 +56,7 @@ package org.apache.commons.graph.visualize;
import java.io.*;
import java.util.StringTokenizer;
import org.apache.commons.graph.Constants;
import org.apache.commons.graph.GraphConstants;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
import org.apache.commons.graph.Vertex;
@@ -73,7 +73,7 @@ import org.apache.commons.graph.visitor.Visitor;
* By default graphs are dumped in the native Java format, i.e. by using the
* Serialization feature.
*
* @version $Id: GraphVisualizer.java,v 1.1 2001/11/29 14:24:23 jvanzyl Exp $
* @version $Id: GraphVisualizer.java,v 1.2 2001/12/02 18:07:18 jvanzyl Exp $
* @author <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
* @see DaVinciVisualizer
* @see GMLVisualizer
@@ -55,7 +55,7 @@ package org.apache.commons.graph.visualize;
*/
import java.io.OutputStream;
import org.apache.commons.graph.Constants;
import org.apache.commons.graph.GraphConstants;
import org.apache.commons.graph.DFS;
import org.apache.commons.graph.Edge;
import org.apache.commons.graph.Graph;
@@ -66,7 +66,7 @@ import org.apache.commons.graph.Vertex;
* HREF="http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html">VCG</A>
* format.
*
* @version $Id: VCGVisualizer.java,v 1.1 2001/11/29 14:24:23 jvanzyl Exp $
* @version $Id: VCGVisualizer.java,v 1.2 2001/12/02 18:07:18 jvanzyl Exp $
* @author <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
*/
public class VCGVisualizer extends GraphVisualizer {