Class DIMACSExporter<V,​E>

    • Field Detail

      • DEFAULT_DIMACS_FORMAT

        public static final DIMACSFormat DEFAULT_DIMACS_FORMAT
        The default format used by the exporter.
    • Constructor Detail

      • DIMACSExporter

        public DIMACSExporter()
        Constructs a new exporter.
      • DIMACSExporter

        public DIMACSExporter​(Function<V,​String> vertexIdProvider)
        Constructs a new exporter with a given vertex ID provider.
        Parameters:
        vertexIdProvider - for generating vertex IDs. Must not be null.
      • DIMACSExporter

        public DIMACSExporter​(Function<V,​String> vertexIdProvider,
                              DIMACSFormat format)
        Constructs a new exporter with a given vertex ID provider.
        Parameters:
        vertexIdProvider - for generating vertex IDs. Must not be null.
        format - the format to use
    • Method Detail

      • exportGraph

        public void exportGraph​(Graph<V,​E> g,
                                Writer writer)
        Description copied from interface: GraphExporter
        Export a graph using the given Writer.

        It is the callers responsibility to ensure the Writer is closed after this method returned.

        Specified by:
        exportGraph in interface GraphExporter<V,​E>
        Parameters:
        g - the graph to export
        writer - the output writer
      • isParameter

        public boolean isParameter​(DIMACSExporter.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​(DIMACSExporter.Parameter p,
                                 boolean value)
        Set the value of a parameter of the exporter
        Parameters:
        p - the parameter
        value - the value to set
      • getFormat

        public DIMACSFormat getFormat()
        Get the format of the exporter
        Returns:
        the format of the exporter
      • setFormat

        public void setFormat​(DIMACSFormat format)
        Set the format of the exporter
        Parameters:
        format - the format to use