Package moss

Class LineReader

All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, Readable

public class LineReader extends GraphReader
Class for readers for simple table formats for graph data sets.
Since:
2007.03.04
See Also:
  • Constructor Details

    • LineReader

      public LineReader(Reader reader, int mode, Notation ntn)
      Create a table reader with default character flags.

      By default the following character settings are used:
      record separators: "\n", field separators: " \t", blanks: " \r\t", comment characters: "#".

      Parameters:
      reader - the reader to work on
      mode - the read mode
      ntn - the notation of the graphs
      Since:
      2006.10.05 (Christian Borgelt)
  • Method Details

    • readHeader

      public boolean readHeader() throws IOException
      Read an (optional) table header.
      Specified by:
      readHeader in class GraphReader
      Returns:
      whether a header was present (otherwise the end of the input has been reached)
      Throws:
      IOException - if an i/o error occurs
      Since:
      2007.03.04 (Christian Borgelt)
    • readGraph

      public boolean readGraph() throws IOException
      Read the next graph description.

      The next graph description is read and split into the graph name/identifier, the graph description, the associated value (only in mode GRAPHS), and the support information (only in mode SUBS).

      These properties may then be retrieved with the functions getName(), getDesc(), getValue() etc.
      Specified by:
      readGraph in class GraphReader
      Returns:
      whether a graph description could be read (otherwise the end of the input has been reached)
      Throws:
      IOException - if an i/o error occurs
      Since:
      2007.03.04 (Christian Borgelt)
    • getGraph

      public Graph getGraph() throws IOException
      Get the current graph or substructure.
      Overrides:
      getGraph in class GraphReader
      Returns:
      the current graph
      Throws:
      IOException - if a parse error occurs
      Since:
      2007.03.04 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main function for testing basic functionality.
      Parameters:
      args - the command line arguments
      Since:
      2007.06.26 (Christian Borgelt)