Package com.jgalgo.io

Class GraphMlGraphWriter<V,​E>

  • All Implemented Interfaces:
    GraphWriter<V,​E>

    public class GraphMlGraphWriter<V,​E>
    extends Object
    Write a graph in 'GraphML' format.

    GraphML is an XML-based format for graphs. Both directed and undirected graphs are supported, along with mixed graphs (some edges are directed while others are undirected) although the Graph does not supported mixed graphs (therefore the writer also doesn't support it). The format support graphs with vertices and edges of any type, as long as they can be written as an XML attribute string. The format also support multiple weights for vertices and edges, of type boolean, int, long, float, double or String, and a default value for each weight type.

    The GraphML format support both self edges and parallel edges.

    Author:
    Barak Ugav
    See Also:
    GraphMlGraphReader
    • Constructor Detail

      • GraphMlGraphWriter

        public GraphMlGraphWriter()
        Create a new writer.
    • Method Detail

      • writeGraph

        public final void writeGraph​(Graph<V,​E> graph,
                                     Writer writer)
        Description copied from interface: GraphWriter
        Write a graph to an I/O writer.
        Specified by:
        writeGraph in interface GraphWriter<V,​E>
        Parameters:
        graph - a graph
        writer - an I/O writer to which the graph description will be written to