public class DOTImporter<V,E> extends Object
For a description of the format see http://en.wikipedia.org/wiki/DOT_language and http://www.graphviz.org/doc/info/lang.html
state machine description (In dot format naturally):
digraph G {
1 [label="start" description="Entry point"];
2 [label="header" description="Processing The header"];
3 [label="next" description="work out what the type of the next node is"];
4 [label="edge" description="process an edge entry"];
5 [label="edge_quotes" description="process a section of an edge in quotes"];
6 [label="node" description="process a node entry"];
7 [label="node_quotes" description="process a section of a node in quotes"];
8 [label="line_comment" description="process and ignore a line comment"];
9 [label="block_comment" description="process and ignore a block comment"];
10 [label="done" description="exit point"];
1 -> 2;
2 -> 3;
3 -> 4;
4 -> 3;
4 -> 5;
5 -> 4;
3 -> 6;
6 -> 3;
6 -> 7;
7 -> 6;
3 -> 10;
2 -> 8;
8 -> 2;
2 -> 9;
9 -> 2;
3 -> 8;
8 -> 3;
3 -> 9;
9 -> 3;
4 -> 8;
8 -> 4;
4 -> 9;
9 -> 4;
6 -> 8;
8 -> 6;
6 -> 9;
9 -> 6;
}
Constructor and Description |
---|
DOTImporter(VertexProvider<V> vertexProvider,
EdgeProvider<V,E> edgeProvider)
Constructs a new DOTImporter with the given providers
|
DOTImporter(VertexProvider<V> vertexProvider,
EdgeProvider<V,E> edgeProvider,
VertexUpdater<V> updater)
Constructs a new DOTImporter with the given providers
|
Modifier and Type | Method and Description |
---|---|
void |
read(String input,
AbstractBaseGraph<V,E> graph)
Read a dot formatted string and populate the provided graph.
|
public DOTImporter(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider)
vertexProvider
- Provider to create a vertexedgeProvider
- Provider to create an edgepublic DOTImporter(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider, VertexUpdater<V> updater)
vertexProvider
- Provider to create a vertexedgeProvider
- Provider to create an edgeupdater
- Method used to update an existing Vertexpublic void read(String input, AbstractBaseGraph<V,E> graph) throws ImportException
input
- the content of a dot file.graph
- the graph to update.ImportException
- if there is a problem parsing the file.Copyright © 2016. All rights reserved.