V
- the graph vertex typeE
- the graph edge typepublic class MatrixExporter<V,E> extends Object implements GraphExporter<V,E>
The exporter supports three different formats, see MatrixExporter.Format
.
MatrixExporter.Format
Modifier and Type | Class and Description |
---|---|
static class |
MatrixExporter.Format
Formats supported by the
MatrixExporter 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 |
---|
MatrixExporter()
Creates a new MatrixExporter with integer name provider for the vertex identifiers and
MatrixExporter.Format.SPARSE_ADJACENCY_MATRIX as the default format. |
MatrixExporter(MatrixExporter.Format format)
Creates a new MatrixExporter with integer name provider for the vertex identifiers.
|
MatrixExporter(MatrixExporter.Format format,
ComponentNameProvider<V> vertexIDProvider)
Creates a new MatrixExporter.
|
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
|
MatrixExporter.Format |
getFormat()
Get the format that the exporter is using.
|
ComponentNameProvider<V> |
getVertexIDProvider()
Get the vertex id provider
|
void |
setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
Set the edge id provider.
|
void |
setFormat(MatrixExporter.Format format)
Set the output format 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 MatrixExporter()
MatrixExporter.Format.SPARSE_ADJACENCY_MATRIX
as the default format.public MatrixExporter(MatrixExporter.Format format)
format
- format to usepublic MatrixExporter(MatrixExporter.Format format, ComponentNameProvider<V> vertexIDProvider)
format
- format to usevertexIDProvider
- for generating vertex identifiers. Must not be null.public MatrixExporter.Format getFormat()
public void setFormat(MatrixExporter.Format format)
format
- the format to usepublic void exportGraph(Graph<V,E> g, Writer writer) throws ExportException
GraphExporter
exportGraph
in interface GraphExporter<V,E>
g
- the graph to exportwriter
- the output writerExportException
- in case any error occurspublic 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 © 2017. All rights reserved.