Class HypergraphParser

java.lang.Object
fr.univartois.cril.jkahypar.tools.HypergraphParser
All Implemented Interfaces:
Closeable, AutoCloseable

public final class HypergraphParser extends Object implements Closeable
The HypergraphParser allows to parse a file in the hMetis format so as to read a Hypergraph instance.
  • Constructor Details

    • HypergraphParser

      public HypergraphParser(String inputFile) throws IOException
      Creates a new HypergraphParser.
      Parameters:
      inputFile - The path of the input file to read the hypergraph from.
      Throws:
      IOException - If an I/O error occurs while opening the file.
    • HypergraphParser

      public HypergraphParser(InputStream stream)
      Creates a new HypergraphParser.
      Parameters:
      stream - The input stream to read the hypergraph from.
  • Method Details

    • parse

      public void parse() throws IOException
      Parses the input stream to read a hypergraph instance.
      Throws:
      IOException - If an I/O error occurs while reading.
    • getHypergraph

      public Hypergraph getHypergraph()
      Gives the hypergraph that has been read from the associated input stream.
      Returns:
      The hypergraph that has been read.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException