V
- the graph vertex typeE
- the graph edge typepublic class LemonExporter<V,E> extends Object implements GraphExporter<V,E>
This is the custom graph format used in the Lemon graph library.
Modifier and Type | Class and Description |
---|---|
static class |
LemonExporter.Parameter
Parameters that affect the behavior of the
LemonExporter exporter. |
Modifier and Type | Field and Description |
---|---|
protected ComponentNameProvider<E> |
edgeIDProvider
Provides an identifier for an edge.
|
protected ComponentNameProvider<V> |
vertexIDProvider
Provides an identifier for a vertex.
|
Constructor and Description |
---|
LemonExporter()
Constructs a new exporter.
|
LemonExporter(ComponentNameProvider<V> vertexIDProvider)
Constructs a new exporter with a given vertex ID provider.
|
Modifier and Type | Method and Description |
---|---|
void |
exportGraph(Graph<V,E> g,
Writer writer)
Export a graph
|
ComponentNameProvider<E> |
getEdgeIDProvider()
Get the edge id provider
|
ComponentNameProvider<V> |
getVertexIDProvider()
Get the vertex id provider
|
boolean |
isParameter(LemonExporter.Parameter p)
Return if a particular parameter of the exporter is enabled
|
void |
setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
Set the edge id provider.
|
void |
setParameter(LemonExporter.Parameter p,
boolean value)
Set the value of a parameter of the exporter
|
void |
setVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)
Set the vertex id provider
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exportGraph, exportGraph
protected ComponentNameProvider<V> vertexIDProvider
protected ComponentNameProvider<E> edgeIDProvider
public LemonExporter()
public LemonExporter(ComponentNameProvider<V> vertexIDProvider)
vertexIDProvider
- for generating vertex IDs. Must not be null.public void exportGraph(Graph<V,E> g, Writer writer)
GraphExporter
exportGraph
in interface GraphExporter<V,E>
g
- the graph to exportwriter
- the output writerpublic boolean isParameter(LemonExporter.Parameter p)
p
- the parametertrue
if the parameter is set, false
otherwisepublic void setParameter(LemonExporter.Parameter p, boolean value)
p
- the parametervalue
- the value to setpublic ComponentNameProvider<V> getVertexIDProvider()
public void setVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)
vertexIDProvider
- the new vertex id provider. Must not be null.public ComponentNameProvider<E> getEdgeIDProvider()
public void setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
edgeIDProvider
- the new edge id provider. Must not be null.Copyright © 2019. All rights reserved.