Interface GraphReader<V>

Type Parameters:
V - Type of the vertices.
All Known Implementing Classes:
BinaryGraphReader, PajekGraphReader, TextGraphReader, TextMultiGraphReader

public interface GraphReader<V>
Interface for graph readers.
  • Method Summary

    Modifier and Type Method Description
    Graph<V> read​(java.io.InputStream stream)
    Given an input stream, reads a file from it (for reading embedded graphs in greater files).
    Graph<V> read​(java.io.InputStream stream, boolean readWeights, boolean readTypes)
    Given an input stream, reads a file from it (for reading embedded graphs in greater files).
    Graph<V> read​(java.io.InputStream stream, boolean readWeights, boolean readTypes, Index<V> nodes)
    Given an input stream, reads a file from it (for reading embedded graphs in greater files).
    Graph<V> read​(java.lang.String file)
    Given a file, reads a graph.
    Graph<V> read​(java.lang.String file, boolean readWeights, boolean readTypes)
    Given a file, reads a graph.
    Graph<V> read​(java.lang.String file, boolean readWeights, boolean readTypes, Index<V> nodes)
    Given an file, reads a graph.
  • Method Details

    • read

      Graph<V> read​(java.lang.String file)
      Given a file, reads a graph.
      Parameters:
      file - The file containing the nodes.
      Returns:
      the graph if everything goes ok, null otherwise.
    • read

      Graph<V> read​(java.lang.String file, boolean readWeights, boolean readTypes)
      Given a file, reads a graph.
      Parameters:
      file - The file containing the graph.
      readWeights - True if the file contains weights, false otherwise.
      readTypes - True if the file contains types, false otherwise.
      Returns:
      the graph if everything goes ok, null otherwise.
    • read

      Graph<V> read​(java.lang.String file, boolean readWeights, boolean readTypes, Index<V> nodes)
      Given an file, reads a graph.
      Parameters:
      file - The file containing the graph.
      readWeights - True if the file contains weights, false otherwise.
      readTypes - True if the file contains graph types.
      nodes - An index containing the nodes in the network.
      Returns:
      the graph if everything goes ok, null otherwise.
    • read

      Graph<V> read​(java.io.InputStream stream)
      Given an input stream, reads a file from it (for reading embedded graphs in greater files). By default, assumes the graph contains information about weights, but not about types.
      Parameters:
      stream - The input stream we read the graph from.
      Returns:
      the graph if everything goes ok, null otherwise.
    • read

      Graph<V> read​(java.io.InputStream stream, boolean readWeights, boolean readTypes)
      Given an input stream, reads a file from it (for reading embedded graphs in greater files).
      Parameters:
      stream - The input stream we read the graph from.
      readWeights - True if the file contains weights, false otherwise.
      readTypes - True if the file contains graph types.
      Returns:
      the graph if everything goes ok, null otherwise.
    • read

      Graph<V> read​(java.io.InputStream stream, boolean readWeights, boolean readTypes, Index<V> nodes)
      Given an input stream, reads a file from it (for reading embedded graphs in greater files).
      Parameters:
      stream - The input stream we read the graph from.
      readWeights - True if the file contains weights, false otherwise.
      readTypes - True if the file contains graph types.
      nodes - An index containing the nodes in the network.
      Returns:
      the graph if everything goes ok, null otherwise.