Class GmlExporter<V,​E>

    • Field Detail

      • LABEL_ATTRIBUTE_KEY

        private static final java.lang.String LABEL_ATTRIBUTE_KEY
        See Also:
        Constant Field Values
      • WEIGHT_ATTRIBUTE_KEY

        private static final java.lang.String WEIGHT_ATTRIBUTE_KEY
        See Also:
        Constant Field Values
      • FORBIDDEN_VERTEX_CUSTOM_ATTRIBUTE_KEYS

        private static final java.util.Set<java.lang.String> FORBIDDEN_VERTEX_CUSTOM_ATTRIBUTE_KEYS
      • FORBIDDEN_EDGE_CUSTOM_ATTRIBUTE_KEYS

        private static final java.util.Set<java.lang.String> FORBIDDEN_EDGE_CUSTOM_ATTRIBUTE_KEYS
    • Constructor Detail

      • GmlExporter

        public GmlExporter()
        Creates a new GmlExporter object with integer id providers for the vertex identifiers.
      • GmlExporter

        public GmlExporter​(java.util.function.Function<V,​java.lang.String> vertexIdProvider)
        Constructs a new GmlExporter object with the given id providers.
        Parameters:
        vertexIdProvider - for generating vertex IDs. Must not be null.
    • Method Detail

      • exportGraph

        public void exportGraph​(Graph<V,​E> g,
                                java.io.Writer writer)
        Exports an graph into a plain text GML format.
        Specified by:
        exportGraph in interface GraphExporter<V,​E>
        Parameters:
        writer - the writer
        g - the graph
      • isParameter

        public boolean isParameter​(GmlExporter.Parameter p)
        Return if a particular parameter of the exporter is enabled
        Parameters:
        p - the parameter
        Returns:
        true if the parameter is set, false otherwise
      • setParameter

        public void setParameter​(GmlExporter.Parameter p,
                                 boolean value)
        Set the value of a parameter of the exporter
        Parameters:
        p - the parameter
        value - the value to set
      • quoted

        private java.lang.String quoted​(java.lang.String s)
      • exportHeader

        private void exportHeader​(java.io.PrintWriter out)
      • exportAttribute

        private void exportAttribute​(java.io.PrintWriter out,
                                     java.lang.String key,
                                     Attribute attribute)
      • exportVertices

        private void exportVertices​(java.io.PrintWriter out,
                                    Graph<V,​E> g)
      • exportEdges

        private void exportEdges​(java.io.PrintWriter out,
                                 Graph<V,​E> g)