Class Graph6Sparse6EventDrivenImporter.Parser

java.lang.Object
org.jgrapht.nio.graph6.Graph6Sparse6EventDrivenImporter.Parser
Enclosing class:
Graph6Sparse6EventDrivenImporter

private class Graph6Sparse6EventDrivenImporter.Parser extends Object
The actual parser. The parser assumes the input is a single line.
  • Field Details

  • Constructor Details

    • Parser

      public Parser(String inputLine)
      Create a new parser.
      Parameters:
      inputLine - an input line
  • Method Details

    • parse

      public void parse()
    • readGraph6

      private void readGraph6() throws ImportException
      Throws:
      ImportException
    • readSparse6

      private void readSparse6() throws ImportException
      Throws:
      ImportException
    • validateInput

      private void validateInput() throws ImportException
      Check whether the g6 or s6 encoding contains any obvious errors
      Throws:
      ImportException - in case any error occurs, such as I/O or parse error
    • readNumberOfVertices

      private void readNumberOfVertices() throws ImportException
      Read the number of vertices in the graph
      Throws:
      ImportException - in case any error occurs, such as I/O or parse error
    • getBits

      private int getBits(int k) throws ImportException
      Converts the next k bits of data to an integer
      Parameters:
      k - number of bits
      Returns:
      the next k bits of data represented by an integer
      Throws:
      ImportException