Class GmlExporter<V,E>
java.lang.Object
org.jgrapht.nio.BaseExporter<V,E>
org.jgrapht.nio.gml.GmlExporter<V,E>
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
GraphExporter<V,E>
Exports a graph into a GML file (Graph Modeling Language).
For a description of the format see https://github.com/GunterMueller/UNI_PASSAU_FMI_Graph_Drawing/blob/master/GML/gml-technical-report.pdf.
The behavior of the exporter such as whether to print vertex labels, edge labels, and/or edge
weights can be adjusted using the setParameter method.
When exporting labels, the exporter escapes them as Java strings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumParameters that affect the behavior of theGmlExporterexporter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate final Set<GmlExporter.Parameter> private static final Stringprivate static final Stringprivate static final Stringprivate static final StringFields inherited from class BaseExporter
edgeAttributeProvider, edgeIdProvider, graphAttributeProvider, graphIdProvider, vertexAttributeProvider, vertexIdProvider -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new GmlExporter object with integer id providers for the vertex identifiers.GmlExporter(Function<V, String> vertexIdProvider) Constructs a new GmlExporter object with the given id providers. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidexportAttribute(PrintWriter out, String key, Attribute attribute) private voidexportEdges(PrintWriter out, Graph<V, E> g) voidexportGraph(Graph<V, E> g, Writer writer) Exports an graph into a plain text GML format.private voidexportHeader(PrintWriter out) private voidexportVertices(PrintWriter out, Graph<V, E> g) booleanReturn if a particular parameter of the exporter is enabledprivate StringvoidsetParameter(GmlExporter.Parameter p, boolean value) Set the value of a parameter of the exporterMethods inherited from class BaseExporter
getEdgeAttribute, getEdgeAttributeProvider, getEdgeAttributes, getEdgeId, getEdgeIdProvider, getGraphAttribute, getGraphAttributeProvider, getGraphId, getGraphIdProvider, getVertexAttribute, getVertexAttributeProvider, getVertexAttributes, getVertexId, getVertexIdProvider, setEdgeAttributeProvider, setEdgeIdProvider, setGraphAttributeProvider, setGraphIdProvider, setVertexAttributeProvider, setVertexIdProviderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GraphExporter
exportGraph, exportGraph
-
Field Details
-
CREATOR
- See Also:
-
VERSION
- See Also:
-
DELIM
- See Also:
-
TAB1
- See Also:
-
TAB2
- See Also:
-
LABEL_ATTRIBUTE_KEY
- See Also:
-
WEIGHT_ATTRIBUTE_KEY
- See Also:
-
FORBIDDEN_VERTEX_CUSTOM_ATTRIBUTE_KEYS
-
FORBIDDEN_EDGE_CUSTOM_ATTRIBUTE_KEYS
-
parameters
-
-
Constructor Details
-
GmlExporter
public GmlExporter()Creates a new GmlExporter object with integer id providers for the vertex identifiers. -
GmlExporter
-
-
Method Details
-
exportGraph
Exports an graph into a plain text GML format.- Specified by:
exportGraphin interfaceGraphExporter<V,E> - Parameters:
g- the graphwriter- the writer
-
isParameter
Return if a particular parameter of the exporter is enabled- Parameters:
p- the parameter- Returns:
trueif the parameter is set,falseotherwise
-
setParameter
Set the value of a parameter of the exporter- Parameters:
p- the parametervalue- the value to set
-
quoted
-
exportHeader
-
exportAttribute
-
exportVertices
-
exportEdges
-