Interface MolImporterInterface

All Known Implementing Classes:
DocumentAnnotator, MoleculeImporter, MolImporter

@PublicApi public interface MolImporterInterface
Interface for molecule importer classes.
Since:
5.7
  • Method Details

    • read

      Molecule read() throws IOException
      Reads the next molecule from the stream/file.
      Returns:
      the next molecule, or null if no more molecules can be imported.
      Throws:
      IOException - if an error occurred during reading.
    • close

      void close() throws IOException
      Closes the underlying input stream.

      WARNING: call this after reading molecules to close concurrent processing properly.

      Throws:
      IOException - if an error occurred.
    • getMolStream

      default Stream<Molecule> getMolStream()
      Creates a Molecule stream with the iterator of the importer.

      WARNING: the default implementation throws UnsupportedOperationException, but certain implementations may support this method.

    • getMDocumentStream

      default Stream<MDocument> getMDocumentStream()
      Creates an MDocument stream with the iterator of the importer. Adds MDocument to molecules without document.

      WARNING: the default implementation throws UnsupportedOperationException, but certain implementations may support this method.