Package moss

Class SDfileReader

All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, Readable

public class SDfileReader extends GraphReader
Class for readers for structure-data files (SDfile, Elsevier MDL).
Since:
2007.02.24
See Also:
  • Constructor Details

    • SDfileReader

      public SDfileReader(Reader reader, int mode, Ctab ntn)
      Create a reader for SDfiles.
      Parameters:
      reader - the reader to read from
      mode - the read mode
      ntn - the notation to use
      Since:
      2007.03.04 (Christian Borgelt)
    • SDfileReader

      public SDfileReader(Reader reader, int mode)
      Create a reader for SDfiles.
      Parameters:
      reader - the reader to read from
      mode - the read mode
      Since:
      2007.03.04 (Christian Borgelt)
  • Method Details

    • readLine

      protected String readLine() throws IOException
      Read the next input line.
      Returns:
      the next input line or null if the end of the input stream has been reached
      Throws:
      IOException - if an i/o error occurs
      Since:
      2007.02.24 (Christian Borgelt)
    • readHeader

      public boolean readHeader() throws IOException
      Read an (optional) header.

      This function always returns false and reads nothing, since headers are not supported with SDfiles.

      Specified by:
      readHeader in class GraphReader
      Returns:
      false, since SDfile do not have a header
      Throws:
      IOException - if an i/o error occurs
      Since:
      2007.03.04 (Christian Borgelt)
    • readGraph

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

      The next graph description is read and split into the graph name, the associated value and the actual graph description.

      These individual parts may then be retrieved with the functions getName(), getValue() and getDesc().
      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 or a parse error occurs
      Since:
      2007.03.02 (Christian Borgelt)
    • getDesc

      public String getDesc()
      Get a (line) description of the current graph.

      Since a connection table is not a line description, it is reformatted into the SMILES format.

      Overrides:
      getDesc in class GraphReader
      Returns:
      a line description (SMILES) of the current graph
      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)