Interface MRecordReader

All Known Implementing Classes:
AbstractMRecordReader

@PublicAPI public interface MRecordReader
Marvin record reader.
Since:
Marvin 5.0, 04/06/2006
  • Method Details

    • setProgressMonitor

      void setProgressMonitor(MProgressMonitor pmon)
      Sets the progress monitor.
      Parameters:
      pmon - the progress monitor
    • nextRecord

      Reads the next record.
      Returns:
      the record or null at end of file
      Throws:
      MRecordParseException - If the record could not be parsed
      IOException - If I/O error occurred
    • skipRecord

      Skips the next record.
      Returns:
      incomplete record information, only the record start and end positions are guaranteed to be set
      Throws:
      MRecordParseException - If the record could not be parsed
      IOException - If I/O error occurred
    • getRecognizedFormat

      String getRecognizedFormat()
      Gets the recognized file format.
      Returns:
      the input file format
    • getHeaderAsString

      String getHeaderAsString()
      Gets the header of the file as a string.
      Returns:
      the header or empty string if there is no header
      Since:
      Marvin 5.0.2, 03/11/2008
    • getFooterAsString

      String getFooterAsString()
      Gets the footer of the file as a string.
      Returns:
      the footer or empty string if there is no footer or not yet read
      Since:
      Marvin 5.0.2, 03/11/2008
    • getOptions

      String getOptions()
      Gets the import options.
      Returns:
      the import options
    • close

      void close() throws IOException
      Closes the input stream.
      Throws:
      IOException - If I/O error occurred
    • getEncapsulatedReader

      MRecordReader getEncapsulatedReader()
      Gets the encapsulated record reader if it exists. For example, in case of a GZIPped, BASE64 encoded molfile, the GzipRecordReader has an encapsulated Base64RecordReader instance.
      Returns:
      the encapsulated record reader or null
    • getMolInputStream

      MolInputStream getMolInputStream()
      Gets the molecule input stream.
      Returns:
      the molecule input stream
    • getFilePointer

      long getFilePointer()
      Gets the current position in the input file.
      Returns:
      the position
    • getLineCount

      int getLineCount()
      Get the current line number.
      Returns:
      the line number
    • isSeekable

      boolean isSeekable()
      Tests whether the record reader is seekable.
      Returns:
      true if it is seekable, false otherwise
    • seek

      void seek(long p, int lcount, int k) throws IOException
      Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
      Parameters:
      p - the file pointer
      lcount - the line count at the specified position
      k - the record count at the specified position
      Throws:
      IOException - if pos is less than 0 or if an I/O error occurs.
    • isPropertyRecord

      boolean isPropertyRecord()
    • detectRecordPositions

      chemaxon.common.util.LongVector detectRecordPositions(chemaxon.common.util.IntVector linenums) throws MolFormatException
      Detects positions of records in the input stream. Optionally returns also with the line number of records.
      Parameters:
      linenums - If not null, stores start line numbers of records in this container.
      Returns:
      container with start and end positions of records (inpair elements describe starting, pairs the ending positions).
      Throws:
      MolFormatException