Package org.jgrapht.io
Class CSVExporter<V,E>
- java.lang.Object
-
- org.jgrapht.io.CSVExporter<V,E>
-
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
GraphExporter<V,E>
@Deprecated public class CSVExporter<V,E> extends Object implements GraphExporter<V,E>
Deprecated.UseCSVExporterinstead.Exports a graph into a CSV Format or any other Delimiter-separated value format.The exporter supports three different formats which can be adjusted using the
setFormatmethod. The supported formats are the same CSV formats used by Gephi . For some of the formats, the behavior of the exporter can be adjusted using thesetParametermethod. SeeCSVFormatfor a description of the formats.The default output respects rfc4180. The caller can also adjust the separator to something like semicolon or pipe instead of comma. In such a case, all fields are escaped using the new separator. See Delimiter- separated values for more information.
- Author:
- Dimitrios Michail
- See Also:
CSVFormat
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentNameProvider<E>edgeIDProviderDeprecated.Provides an identifier for an edge.protected ComponentNameProvider<V>vertexIDProviderDeprecated.Provides an identifier for a vertex.
-
Constructor Summary
Constructors Constructor Description CSVExporter()Deprecated.Creates a new CSVExporter withCSVFormat.ADJACENCY_LISTformat and integer name provider for the vertices.CSVExporter(ComponentNameProvider<V> vertexIDProvider, CSVFormat format, char delimiter)Deprecated.Constructs a new CSVExporter with the given ID providers and format.CSVExporter(CSVFormat format)Deprecated.Creates a new CSVExporter with integer name providers for the vertices.CSVExporter(CSVFormat format, char delimiter)Deprecated.Creates a new CSVExporter with integer name providers for the vertices.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidexportGraph(Graph<V,E> g, Writer writer)Deprecated.Exports a graphchargetDelimiter()Deprecated.Get the delimiter (comma, semicolon, pipe, etc).ComponentNameProvider<E>getEdgeIDProvider()Deprecated.Get the edge id providerCSVFormatgetFormat()Deprecated.Get the format of the exporterComponentNameProvider<V>getVertexIDProvider()Deprecated.Get the vertex id providerbooleanisParameter(CSVFormat.Parameter p)Deprecated.Return if a particular parameter of the exporter is enabledvoidsetDelimiter(char delimiter)Deprecated.Set the delimiter (comma, semicolon, pipe, etc).voidsetEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)Deprecated.Set the edge id provider.voidsetFormat(CSVFormat format)Deprecated.Set the format of the exportervoidsetParameter(CSVFormat.Parameter p, boolean value)Deprecated.Set the value of a parameter of the exportervoidsetVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)Deprecated.Set the vertex id provider-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jgrapht.io.GraphExporter
exportGraph, exportGraph
-
-
-
-
Field Detail
-
vertexIDProvider
protected ComponentNameProvider<V> vertexIDProvider
Deprecated.Provides an identifier for a vertex.
-
edgeIDProvider
protected ComponentNameProvider<E> edgeIDProvider
Deprecated.Provides an identifier for an edge.
-
-
Constructor Detail
-
CSVExporter
public CSVExporter()
Deprecated.Creates a new CSVExporter withCSVFormat.ADJACENCY_LISTformat and integer name provider for the vertices.
-
CSVExporter
public CSVExporter(CSVFormat format)
Deprecated.Creates a new CSVExporter with integer name providers for the vertices.- Parameters:
format- the format to use
-
CSVExporter
public CSVExporter(CSVFormat format, char delimiter)
Deprecated.Creates a new CSVExporter with integer name providers for the vertices.- Parameters:
format- the format to usedelimiter- delimiter to use
-
CSVExporter
public CSVExporter(ComponentNameProvider<V> vertexIDProvider, CSVFormat format, char delimiter)
Deprecated.Constructs a new CSVExporter with the given ID providers and format.- Parameters:
vertexIDProvider- for generating vertex IDs. Must not be null.format- the format to usedelimiter- delimiter to use
-
-
Method Detail
-
exportGraph
public void exportGraph(Graph<V,E> g, Writer writer)
Deprecated.Exports a graph- Specified by:
exportGraphin interfaceGraphExporter<V,E>- Parameters:
g- the graphwriter- the writer
-
isParameter
public boolean isParameter(CSVFormat.Parameter p)
Deprecated.Return if a particular parameter of the exporter is enabled- Parameters:
p- the parameter- Returns:
trueif the parameter is set,falseotherwise
-
setParameter
public void setParameter(CSVFormat.Parameter p, boolean value)
Deprecated.Set the value of a parameter of the exporter- Parameters:
p- the parametervalue- the value to set
-
getFormat
public CSVFormat getFormat()
Deprecated.Get the format of the exporter- Returns:
- the format of the exporter
-
setFormat
public void setFormat(CSVFormat format)
Deprecated.Set the format of the exporter- Parameters:
format- the format to use
-
getDelimiter
public char getDelimiter()
Deprecated.Get the delimiter (comma, semicolon, pipe, etc).- Returns:
- the delimiter
-
setDelimiter
public void setDelimiter(char delimiter)
Deprecated.Set the delimiter (comma, semicolon, pipe, etc).- Parameters:
delimiter- the delimiter to use
-
getVertexIDProvider
public ComponentNameProvider<V> getVertexIDProvider()
Deprecated.Get the vertex id provider- Returns:
- the vertex id provider
-
setVertexIDProvider
public void setVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)
Deprecated.Set the vertex id provider- Parameters:
vertexIDProvider- the new vertex id provider. Must not be null.
-
getEdgeIDProvider
public ComponentNameProvider<E> getEdgeIDProvider()
Deprecated.Get the edge id provider- Returns:
- The edge provider
-
setEdgeIDProvider
public void setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
Deprecated.Set the edge id provider.- Parameters:
edgeIDProvider- the new edge id provider. Must not be null.
-
-