Package com.jgalgo.io
Interface GraphReader<V,E>
-
- Type Parameters:
V
- the vertices typeE
- 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:
GraphWriter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Graph<V,E>
readGraph(File file)
Read a graph from a file.default Graph<V,E>
readGraph(Reader reader)
Read a graph from an I/O reader.default Graph<V,E>
readGraph(String path)
Read a graph from a file, given a path to it.GraphBuilder<V,E>
readIntoBuilder(Reader reader)
Read a graph from an I/O reader into aGraphBuilder
.
-
-
-
Method Detail
-
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 aGraphBuilder
.- 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
-
-