Class GraphMLExporter<V,​E>

    • Constructor Detail

      • GraphMLExporter

        public GraphMLExporter()
        Constructs a new GraphMLExporter with integer id provider for the vertices.
      • GraphMLExporter

        public GraphMLExporter​(java.util.function.Function<V,​java.lang.String> vertexIdProvider)
        Constructs a new GraphMLExporter.
        Parameters:
        vertexIdProvider - for generating vertex identifiers. Must not be null.
    • Method Detail

      • registerAttribute

        public void registerAttribute​(java.lang.String name,
                                      GraphMLExporter.AttributeCategory category,
                                      AttributeType type)
        Register a GraphML-Attribute
        Parameters:
        name - the attribute name
        category - the attribute category
        type - the attribute type
      • registerAttribute

        public void registerAttribute​(java.lang.String name,
                                      GraphMLExporter.AttributeCategory category,
                                      AttributeType type,
                                      java.lang.String defaultValue)
        Register a GraphML-Attribute
        Parameters:
        name - the attribute name
        category - the attribute category
        type - the attribute type
        defaultValue - default value
      • unregisterAttribute

        public void unregisterAttribute​(java.lang.String name)
        Unregister a GraphML-Attribute
        Parameters:
        name - the attribute name
      • isExportEdgeWeights

        public boolean isExportEdgeWeights()
        Whether the exporter will print edge weights.
        Returns:
        true if the exporter prints edge weights, false otherwise
      • setExportEdgeWeights

        public void setExportEdgeWeights​(boolean exportEdgeWeights)
        Set whether the exporter will print edge weights.
        Parameters:
        exportEdgeWeights - value to set
      • isExportVertexLabels

        public boolean isExportVertexLabels()
        Whether the exporter will print vertex labels.
        Returns:
        true if the exporter prints vertex labels, false otherwise
      • setExportVertexLabels

        public void setExportVertexLabels​(boolean exportVertexLabels)
        Set whether the exporter will print vertex labels.
        Parameters:
        exportVertexLabels - value to set
      • isExportEdgeLabels

        public boolean isExportEdgeLabels()
        Whether the exporter will print edge labels.
        Returns:
        true if the exporter prints edge labels, false otherwise
      • setExportEdgeLabels

        public void setExportEdgeLabels​(boolean exportEdgeLabels)
        Set whether the exporter will print edge labels.
        Parameters:
        exportEdgeLabels - value to set
      • getVertexLabelAttributeName

        public java.lang.String getVertexLabelAttributeName()
        Get the attribute name for vertex labels
        Returns:
        the attribute name
      • setVertexLabelAttributeName

        public void setVertexLabelAttributeName​(java.lang.String vertexLabelAttributeName)
        Set the attribute name to use for vertex labels.
        Parameters:
        vertexLabelAttributeName - the attribute name
      • getEdgeLabelAttributeName

        public java.lang.String getEdgeLabelAttributeName()
        Get the attribute name for edge labels
        Returns:
        the attribute name
      • setEdgeLabelAttributeName

        public void setEdgeLabelAttributeName​(java.lang.String edgeLabelAttributeName)
        Set the attribute name to use for edge labels.
        Parameters:
        edgeLabelAttributeName - the attribute name
      • getEdgeWeightAttributeName

        public java.lang.String getEdgeWeightAttributeName()
        Get the attribute name for edge weights
        Returns:
        the attribute name
      • setEdgeWeightAttributeName

        public void setEdgeWeightAttributeName​(java.lang.String edgeWeightAttributeName)
        Set the attribute name to use for edge weights.
        Parameters:
        edgeWeightAttributeName - the attribute name
      • exportGraph

        public void exportGraph​(Graph<V,​E> g,
                                java.io.Writer writer)
        Exports a graph in GraphML format.
        Specified by:
        exportGraph in interface GraphExporter<V,​E>
        Parameters:
        g - the graph
        writer - the writer to export the graph
        Throws:
        ExportException - in case any error occurs during export