Package com.jgalgo.io

Interface GraphReader<V,E>

Type Parameters:
V - the vertices type
E - the edges type
All Known Implementing Classes:
Digraph6GraphReader, DimacsGraphReader, GexfGraphReader, GmlGraphReader, Graph6GraphReader, GraphMlGraphReader, LedaGraphReader, Sparse6GraphReader

public interface GraphReader<V,E>
A reader that reads Graphs from files/IO-reader.
Author:
Barak Ugav
See Also:
  • Method Details

    • readGraph

      default Graph<V,E> readGraph(Reader reader)
      Read a graph from an I/O reader.
      Parameters:
      reader - an I/O reader that contain a graph description
      Returns:
      a new graph read from the reader
      Throws:
      UncheckedIOException - if an I/O error occurs
    • readGraph

      default Graph<V,E> readGraph(File file)
      Read a graph from a file.
      Parameters:
      file - a file that contain a graph description
      Returns:
      a new graph read from the file
      Throws:
      UncheckedIOException - if an I/O error occurs
    • readGraph

      default Graph<V,E> readGraph(String path)
      Read a graph from a file, given a path to it.
      Parameters:
      path - a path to a file that contain a graph description
      Returns:
      a new graph read from the file
      Throws:
      UncheckedIOException - if an I/O error occurs
    • readIntoBuilder

      GraphBuilder<V,E> readIntoBuilder(Reader reader)
      Read a graph from an I/O reader into a GraphBuilder.
      Parameters:
      reader - an I/O reader that contain a graph description
      Returns:
      a graph builder containing the vertices and edge read from the reader
      Throws:
      UncheckedIOException - if an I/O error occurs