public class DotParser extends Object implements GraphConstants
DIRECTED, DOUBLE, NORMAL, PLURAL_DUMMY, REVERSED, SINGULAR_DUMMY| Constructor and Description |
|---|
DotParser(Reader input,
ArrayList<GraphNode> nodes,
ArrayList<GraphEdge> edges)
Dot parser Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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(String filename,
String graphName,
ArrayList<GraphNode> nodes,
ArrayList<GraphEdge> edges)
This method saves a graph in a file in DOT format.
|
public DotParser(Reader input, ArrayList<GraphNode> nodes, 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 String parse()
public static void writeDOT(String filename, String graphName, ArrayList<GraphNode> nodes, 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 edgesCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.