java.lang.Object
org.jgrapht.nio.BaseExporter<V,E>
org.jgrapht.nio.lemon.LemonExporter<V,E>
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
GraphExporter<V,E>
Exports a graph into Lemon graph format (LGF).
This is the custom graph format used in the Lemon graph library.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumParameters that affect the behavior of theLemonExporterexporter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate final Set<LemonExporter.Parameter> private static final Stringprivate static final StringFields inherited from class org.jgrapht.nio.BaseExporter
edgeAttributeProvider, edgeIdProvider, graphAttributeProvider, graphIdProvider, vertexAttributeProvider, vertexIdProvider -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new exporter.LemonExporter(Function<V, String> vertexIdProvider) Constructs a new exporter with a given vertex id provider. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidexportEdges(PrintWriter out, Graph<V, E> g) voidexportGraph(Graph<V, E> g, Writer writer) Export a graph using the givenWriter.private voidexportHeader(PrintWriter out) private voidexportVertices(PrintWriter out, Graph<V, E> g) booleanReturn if a particular parameter of the exporter is enabledprivate StringvoidsetParameter(LemonExporter.Parameter p, boolean value) Set the value of a parameter of the exporterMethods 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, setVertexIdProviderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgrapht.nio.GraphExporter
exportGraph, exportGraph
-
Field Details
-
CREATOR
- See Also:
-
VERSION
- See Also:
-
DELIM
- See Also:
-
TAB1
- See Also:
-
parameters
-
-
Constructor Details
-
LemonExporter
public LemonExporter()Constructs a new exporter. -
LemonExporter
Constructs a new exporter with a given vertex id provider.- Parameters:
vertexIdProvider- for generating vertex IDs. Must not be null.
-
-
Method Details
-
exportGraph
Description copied from interface:GraphExporterExport a graph using the givenWriter.It is the callers responsibility to ensure the
Writeris closed after this method returned.- Specified by:
exportGraphin interfaceGraphExporter<V,E> - Parameters:
g- the graph to exportwriter- the output 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
-
prepareId
-
exportHeader
-
exportVertices
-
exportEdges
-