java.lang.Object
org.jgrapht.nio.BaseExporter<V,E>
org.jgrapht.nio.dot.DOTExporter<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
GraphExporter<V,E>
public class DOTExporter<V,E> extends BaseExporter<V,E> implements GraphExporter<V,E>
Exports a graph into a DOT file.
For a description of the format see http://en.wikipedia.org/wiki/DOT_language.
The user can adjust the behavior using the various providers.- Author:
- Trevor Harmon, Dimitrios Michail
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_GRAPH_ID
Default graph id used by the exporter.Fields inherited from class org.jgrapht.nio.BaseExporter
edgeAttributeProvider, edgeIdProvider, graphAttributeProvider, graphIdProvider, vertexAttributeProvider, vertexIdProvider
-
Constructor Summary
Constructors Constructor Description DOTExporter()
Constructs a new DOTExporter object with an integer id provider.DOTExporter(java.util.function.Function<V,java.lang.String> vertexIdProvider)
Constructs a new DOTExporter object with the given id provider. -
Method Summary
Modifier and Type Method Description void
exportGraph(Graph<V,E> g, java.io.Writer writer)
Exports a graph into a plain text file in DOT format.Methods inherited from class org.jgrapht.nio.BaseExporter
getEdgeAttribute, getEdgeAttributeProvider, getEdgeAttributes, getEdgeId, getEdgeIdProvider, getGraphAttribute, getGraphAttributeProvider, getGraphId, getGraphIdProvider, getVertexAttribute, getVertexAttributeProvider, getVertexAttributes, getVertexId, getVertexIdProvider, setEdgeAttributeProvider, setEdgeIdProvider, setGraphAttributeProvider, setGraphIdProvider, setVertexAttributeProvider, setVertexIdProvider
-
Field Details
-
DEFAULT_GRAPH_ID
public static final java.lang.String DEFAULT_GRAPH_IDDefault graph id used by the exporter.- See Also:
- Constant Field Values
-
-
Constructor Details
-
DOTExporter
public DOTExporter()Constructs a new DOTExporter object with an integer id provider. -
DOTExporter
Constructs a new DOTExporter object with the given id provider. Additional providers such as attributes can be given using the appropriate setter methods.- Parameters:
vertexIdProvider
- for generating vertex IDs. Must not be null.
-
-
Method Details
-
exportGraph
Exports a graph into a plain text file in DOT format.- Specified by:
exportGraph
in interfaceGraphExporter<V,E>
- Parameters:
g
- the graph to be exportedwriter
- the writer to which the graph to be exported
-