public class DotParser extends java.lang.Object implements GraphConstants
DIRECTED, DOUBLE, NORMAL, PLURAL_DUMMY, REVERSED, SINGULAR_DUMMY
Constructor and Description |
---|
DotParser(java.io.Reader input,
java.util.ArrayList<GraphNode> nodes,
java.util.ArrayList<GraphEdge> edges)
Dot parser Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
parse()
This method parses the string or the InputStream that we passed in through
the constructor and builds up the m_nodes and m_edges vectors
|
static void |
writeDOT(java.lang.String filename,
java.lang.String graphName,
java.util.ArrayList<GraphNode> nodes,
java.util.ArrayList<GraphEdge> edges)
This method saves a graph in a file in DOT format.
|
public DotParser(java.io.Reader input, java.util.ArrayList<GraphNode> nodes, java.util.ArrayList<GraphEdge> edges)
input
- - The input, if passing in a string then encapsulate that in
String reader objectnodes
- - Vector to put in GraphNode objects, corresponding to the
nodes parsed in from the inputedges
- - Vector to put in GraphEdge objects, corresponding to the
edges parsed in from the inputpublic java.lang.String parse()
public static void writeDOT(java.lang.String filename, java.lang.String graphName, java.util.ArrayList<GraphNode> nodes, java.util.ArrayList<GraphEdge> edges)
filename
- - The name of the file to write in. (will overwrite)graphName
- - The name of the graphnodes
- - Vector containing all the nodesedges
- - Vector containing all the edges