Class Graph6Sparse6EventDrivenImporter.Parser

  • Enclosing class:
    Graph6Sparse6EventDrivenImporter

    private class Graph6Sparse6EventDrivenImporter.Parser
    extends java.lang.Object
    The actual parser. The parser assumes the input is a single line.
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser​(java.lang.String inputLine)
      Create a new parser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int getBits​(int k)
      Converts the next k bits of data to an integer
      void parse()  
      private void readGraph6()  
      private void readNumberOfVertices()
      Read the number of vertices in the graph
      private void readSparse6()  
      private void validateInput()
      Check whether the g6 or s6 encoding contains any obvious errors
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Parser

        public Parser​(java.lang.String inputLine)
        Create a new parser.
        Parameters:
        inputLine - an input line
    • Method Detail

      • parse

        public void parse()
      • 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