Class MoleculeImporter

    • Field Detail

      • importer

        protected final chemaxon.marvin.io.formats.MoleculeImporterIface importer
        The wrapped importer. Created in the constructor, the interface methods delegates the functionality to this importer.
    • Constructor Detail

      • MoleculeImporter

        public MoleculeImporter​(String fileName)
                         throws IOException
        Constructs a new importer for the file.
        Parameters:
        fileName - the name of the file to import.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(String fileName,
                                String opts)
                         throws IOException
        Constructs a new importer for the file.
        Parameters:
        fileName - the name of the file to import.
        opts - the file format and options separated by a colon. Autorecognition is called if null or format is not specified.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(File f)
                         throws IOException
        Constructs a new importer for the file.
        Parameters:
        f - the file to import.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(File f,
                                String opts)
                         throws IOException
        Constructs a new importer for the file.
        Parameters:
        f - the file to import.
        opts - the file format and options separated by a colon. Autorecognition is called if null or format is not specified.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(InputStream inputStream)
                         throws IOException
        Constructs a new importer for the input stream.
        Parameters:
        inputStream - the stream to import from.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(InputStream inputStream,
                                String opts)
                         throws IOException
        Constructs a new importer for the stream.
        Parameters:
        inputStream - the stream to import from.
        opts - the file format and options separated by a colon. Autorecognition is called if null or format is not specified.
        Throws:
        IOException - if an I/O error occurs.
      • MoleculeImporter

        public MoleculeImporter​(InputStream inputStream,
                                String opts,
                                String enc)
                         throws IOException
        Constructs a new importer for the stream.
        Parameters:
        inputStream - the stream to import from.
        opts - the file format and options separated by a colon. Autorecognition is called if null or format is not specified.
        enc - the encoding of the stream. Autorecognition may be called if null.
        Throws:
        IOException - if an I/O error occurs.
    • Method Detail

      • read

        public Molecule read()
                      throws IOException
        Specified by:
        read in interface chemaxon.marvin.io.formats.MoleculeImporterIface
        Throws:
        IOException
      • getIterator

        public Iterator<Molecule> getIterator()
        Returns an iterator that iterates through all molecules in the file/stream.
        Returns:
        the iterator.
      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface chemaxon.marvin.io.formats.MoleculeImporterIface
        Throws:
        IOException