V
- graph vertex typeE
- graph edge typepublic class Graph6Sparse6Importer<V,E> extends Object implements GraphImporter<V,E>
Modifier and Type | Field and Description |
---|---|
protected EdgeProvider<V,E> |
edgeProvider
Constructs new edges
|
protected ComponentUpdater<Graph<V,E>> |
graphUpdater
Updates graph properties
|
protected VertexProvider<V> |
vertexProvider
Constructs new vertices
|
protected ComponentUpdater<V> |
vertexUpdater
Updates already constructed vertices
|
Constructor and Description |
---|
Graph6Sparse6Importer(VertexProvider<V> vertexProvider,
EdgeProvider<V,E> edgeProvider)
Construct a new Graph6Sparse6Importer
|
Graph6Sparse6Importer(VertexProvider<V> vertexProvider,
EdgeProvider<V,E> edgeProvider,
double defaultWeight)
Construct a new Graph6Sparse6Importer
|
Modifier and Type | Method and Description |
---|---|
EdgeProvider<V,E> |
getEdgeProvider()
Get the edge provider
|
ComponentUpdater<Graph<V,E>> |
getGraphUpdater()
Get the graph updater.
|
VertexProvider<V> |
getVertexProvider()
Get the vertex provider
|
ComponentUpdater<V> |
getVertexUpdater()
Get the vertex updater
|
void |
importGraph(Graph<V,E> g,
Reader input)
Import a graph
|
void |
importGraph(Graph<V,E> g,
String g6)
Import the graph represented by a String in graph6 or sparse6 encoding.
|
void |
setEdgeProvider(EdgeProvider<V,E> edgeProvider)
Set the edge provider.
|
void |
setGraphUpdater(ComponentUpdater<Graph<V,E>> graphUpdater)
Set the graph updater.
|
void |
setVertexProvider(VertexProvider<V> vertexProvider)
Set the vertex provider
|
void |
setVertexUpdater(ComponentUpdater<V> vertexUpdater)
Set the vertex updater.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
importGraph, importGraph
protected VertexProvider<V> vertexProvider
protected EdgeProvider<V,E> edgeProvider
protected ComponentUpdater<V> vertexUpdater
protected ComponentUpdater<Graph<V,E>> graphUpdater
public Graph6Sparse6Importer(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider, double defaultWeight)
vertexProvider
- provider for the generation of vertices. Must not be null.edgeProvider
- provider for the generation of edges. Must not be null.defaultWeight
- default edge weightpublic Graph6Sparse6Importer(VertexProvider<V> vertexProvider, EdgeProvider<V,E> edgeProvider)
vertexProvider
- provider for the generation of vertices. Must not be null.edgeProvider
- provider for the generation of edges. Must not be null.public void importGraph(Graph<V,E> g, Reader input) throws ImportException
GraphImporter
importGraph
in interface GraphImporter<V,E>
g
- the graphinput
- the input readerImportException
- in case any error occurs, such as I/O or parse errorpublic void importGraph(Graph<V,E> g, String g6) throws ImportException
g
- the graphg6
- String representation of a graph either in graph6 or sparse6 format. WARNING: a
g6/s6 string may contain backslashes '\'. Escaping is required when invoking this
method directly. E.g.
importgraph(g,":?@MnDA\oi")
may result in undefined behavior. This should have been:
importgraph(g,":?@MnDA\\oi")
ImportException
- in case any error occurs, such as I/O or parse errorpublic VertexProvider<V> getVertexProvider()
public void setVertexProvider(VertexProvider<V> vertexProvider)
vertexProvider
- the new vertex provider. Must not be null.public EdgeProvider<V,E> getEdgeProvider()
public void setEdgeProvider(EdgeProvider<V,E> edgeProvider)
edgeProvider
- the new edge provider. Must not be null.public ComponentUpdater<V> getVertexUpdater()
public void setVertexUpdater(ComponentUpdater<V> vertexUpdater)
vertexUpdater
- the new vertex updater. Must not be null.public ComponentUpdater<Graph<V,E>> getGraphUpdater()
public void setGraphUpdater(ComponentUpdater<Graph<V,E>> graphUpdater)
graphUpdater
- the new graph updater. Must not be null.Copyright © 2019. All rights reserved.