V
- the graph vertex typeE
- the graph edge typepublic class DOTImporter<V,E> extends Object implements GraphImporter<V,E>
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;
}
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_GRAPH_ID_KEY
Default key used in the graph updater (if provided) for the graph ID.
|
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,
ComponentUpdater<V> vertexUpdater)
Constructs a new DOTImporter with the given providers
|
DOTImporter(VertexProvider<V> vertexProvider,
EdgeProvider<V,E> edgeProvider,
ComponentUpdater<V> vertexUpdater,
ComponentUpdater<Graph<V,E>> graphUpdater)
Constructs a new DOTImporter with the given providers
|
Modifier and Type | Method and Description |
---|---|
void |
importGraph(Graph<V,E> graph,
Reader input)
Read a dot formatted input and populate the provided graph.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
importGraph, importGraph
public static final String DEFAULT_GRAPH_ID_KEY
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, ComponentUpdater<V> vertexUpdater)
vertexProvider
- Provider to create a vertexedgeProvider
- Provider to create an edgevertexUpdater
- Method used to update an existing Vertexpublic DOTImporter(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider, ComponentUpdater<V> vertexUpdater, ComponentUpdater<Graph<V,E>> graphUpdater)
vertexProvider
- Provider to create a vertexedgeProvider
- Provider to create an edgevertexUpdater
- Method used to update an existing VertexgraphUpdater
- Method used to update the graph IDpublic void importGraph(Graph<V,E> graph, Reader input) throws ImportException
importGraph
in interface GraphImporter<V,E>
graph
- the graph to updateinput
- the input readerImportException
- if there is a problem parsing the file.Copyright © 2017. All rights reserved.