Package com.gengoai.graph.io
Class GraphViz<V>
- java.lang.Object
-
- com.gengoai.graph.io.GraphViz<V>
-
- Type Parameters:
V
- the vertex type
- All Implemented Interfaces:
GraphRenderer<V>
,GraphWriter<V>
public class GraphViz<V> extends Object implements GraphWriter<V>, GraphRenderer<V>
An implementation of a
GraphRender
andGraphWriter
for GraphViz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GraphViz.Format
static class
GraphViz.GraphVizBuilder<V>
-
Constructor Summary
Constructors Constructor Description GraphViz()
Instantiates a new GraphViz writer/renderer.GraphViz(EdgeEncoder<V> edgeEncoder)
Instantiates a new GraphViz writer/renderer.GraphViz(VertexEncoder<V> vertexEncoder)
Instantiates a new GraphViz writer/renderer.GraphViz(VertexEncoder<V> vertexEncoder, EdgeEncoder<V> edgeEncoder)
Instantiates a new GraphViz writer/renderer.GraphViz(VertexEncoder<V> vertexEncoder, EdgeEncoder<V> edgeEncoder, GraphViz.Format format)
Instantiates a new GraphViz writer/renderer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> GraphViz.GraphVizBuilder<V>
builder()
void
render(Graph<V> graph, Resource location, Multimap<String,String> parameters)
Renders the given graph to the give location, using the defined vertex and edge encoders.void
setEdgeEncoder(EdgeEncoder<V> edgeEncoder)
Sets the edge encoder.void
setFormat(GraphViz.Format format)
Sets format.void
setVertexEncoder(VertexEncoder<V> vertexEncoder)
Sets the vertex encodervoid
write(Graph<V> graph, Resource location, Multimap<String,String> parameters)
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.graph.io.GraphRenderer
render
-
Methods inherited from interface com.gengoai.graph.io.GraphWriter
write
-
-
-
-
Constructor Detail
-
GraphViz
public GraphViz()
Instantiates a new GraphViz writer/renderer.
-
GraphViz
public GraphViz(VertexEncoder<V> vertexEncoder)
Instantiates a new GraphViz writer/renderer.- Parameters:
vertexEncoder
- the vertex encoder
-
GraphViz
public GraphViz(EdgeEncoder<V> edgeEncoder)
Instantiates a new GraphViz writer/renderer.- Parameters:
edgeEncoder
- the edge encoder
-
GraphViz
public GraphViz(VertexEncoder<V> vertexEncoder, EdgeEncoder<V> edgeEncoder)
Instantiates a new GraphViz writer/renderer.- Parameters:
vertexEncoder
- the vertex encoderedgeEncoder
- the edge encoder
-
GraphViz
public GraphViz(VertexEncoder<V> vertexEncoder, EdgeEncoder<V> edgeEncoder, GraphViz.Format format)
Instantiates a new GraphViz writer/renderer.- Parameters:
vertexEncoder
- the vertex encoderedgeEncoder
- the edge encoderformat
- the format
-
-
Method Detail
-
builder
public static <V> GraphViz.GraphVizBuilder<V> builder()
-
render
public void render(Graph<V> graph, Resource location, Multimap<String,String> parameters) throws IOException
Description copied from interface:GraphRenderer
Renders the given graph to the give location, using the defined vertex and edge encoders.- Specified by:
render
in interfaceGraphRenderer<V>
- Parameters:
graph
- the graph to renderlocation
- the location to write the rendering toparameters
- multimap of parameters used by the underling render- Throws:
IOException
- Something went wrong rendering the graph
-
setEdgeEncoder
public void setEdgeEncoder(EdgeEncoder<V> edgeEncoder)
Description copied from interface:GraphWriter
Sets the edge encoder.- Specified by:
setEdgeEncoder
in interfaceGraphRenderer<V>
- Specified by:
setEdgeEncoder
in interfaceGraphWriter<V>
- Parameters:
edgeEncoder
- the encoder
-
setFormat
public void setFormat(GraphViz.Format format)
Sets format.- Parameters:
format
- the format
-
setVertexEncoder
public void setVertexEncoder(VertexEncoder<V> vertexEncoder)
Description copied from interface:GraphWriter
Sets the vertex encoder- Specified by:
setVertexEncoder
in interfaceGraphRenderer<V>
- Specified by:
setVertexEncoder
in interfaceGraphWriter<V>
- Parameters:
vertexEncoder
- the encoder
-
write
public void write(Graph<V> graph, Resource location, Multimap<String,String> parameters) throws IOException
Description copied from interface:GraphWriter
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.- Specified by:
write
in interfaceGraphWriter<V>
- Parameters:
graph
- the graph to writelocation
- the location to write toparameters
- multimap of parameters used by the underling writer- Throws:
IOException
- Something went wrong writing the graph
-
-