Module org.hsqldb
Package org.hsqldb.lib

## Class LineGroupReader

- java.lang.Object
- - org.hsqldb.lib.LineGroupReader

-     public class LineGroupReader
      extends java.lang.Object

  Uses a LineNumberReader and returns multiple consecutive lines which conform to the specified group demarcation characteristics. Any exception thrown while reading from the reader is handled internally.
  Since:
    1.9.0
  Author:
    Fred Toussi (fredt@users dot sourceforge.net)

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LineGroupReader​(java.io.LineNumberReader reader)` | Default constructor for TestUtil usage.
    `LineGroupReader​(java.io.LineNumberReader reader, java.lang.String[] sectionStarts)` | Constructor for sections starting with specified strings.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `static java.lang.String` | `convertToString​(HsqlArrayList<java.lang.String> list, int offset)` |
    `OrderedHashMap<java.lang.String,​java.lang.String>` | `getAsMap()` | Returns a map/list which contains the first line of each line group as key and the rest of the lines as a String value.
    `static LineGroupReader` | `getGroupReader​(java.lang.String path)` |
    `static LineGroupReader` | `getGroupReader​(java.lang.String path, java.lang.String[] starters)` |
    `HsqlArrayList<java.lang.String>` | `getNextSection()` |
    `java.lang.String` | `getSectionAsString()` |
    `int` | `getStartLineNumber()` |
    `static OrderedHashMap<java.lang.String,​java.lang.String>` | `getStatementMap​(java.lang.String path)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LineGroupReader

          public LineGroupReader​(java.io.LineNumberReader reader)

      Default constructor for TestUtil usage. Sections start at lines beginning with any non-space character. SQL comment lines are ignored.
      Parameters:
        `reader` - LineNumberReader

    - #### LineGroupReader

          public LineGroupReader​(java.io.LineNumberReader reader,
                                 java.lang.String[] sectionStarts)

      Constructor for sections starting with specified strings.
      Parameters:
        `reader` - LineNumberReader
        `sectionStarts` - String[]

  - ### Method Detail

    - #### getNextSection

          public HsqlArrayList<java.lang.String> getNextSection()

    - #### getSectionAsString

          public java.lang.String getSectionAsString()

    - #### getAsMap

          public OrderedHashMap<java.lang.String,​java.lang.String> getAsMap()

      Returns a map/list which contains the first line of each line group as key and the rest of the lines as a String value.
      Returns:
        OrderedHashMap

    - #### getStartLineNumber

          public int getStartLineNumber()

    - #### close

          public void close()

    - #### convertToString

          public static java.lang.String convertToString​(HsqlArrayList<java.lang.String> list,
                                                         int offset)

    - #### getStatementMap

          public static OrderedHashMap<java.lang.String,​java.lang.String> getStatementMap​(java.lang.String path)

    - #### getGroupReader

          public static LineGroupReader getGroupReader​(java.lang.String path,
                                                       java.lang.String[] starters)

    - #### getGroupReader

          public static LineGroupReader getGroupReader​(java.lang.String path)