Package chemaxon.marvin.io.formats
Class MoleculeImporter
java.lang.Object
chemaxon.marvin.io.formats.MoleculeImporter
- All Implemented Interfaces:
chemaxon.marvin.io.formats.MoleculeImporterIface
@PublicAPI
public class MoleculeImporter
extends Object
implements chemaxon.marvin.io.formats.MoleculeImporterIface
Molecule importer.
Wrapper for MolImporter. Can only read the stream forward
(not seekable stream). In some cases (mrv, cml) it can be faster than
MolImporter.
The input file format is guessed automatically or specified as an import option to the constructor. Many different formats are supported like "mol", "rgf", "sdf", "rdf", "csmol", "csrgf", "cssdf", "csrdf", "mol2", "cml", "mrv", "smiles", "cxsmiles", "pdb", "xyz", "cube", "name". For more information on formats, please visit File Formats in Marvin.
- Since:
- Marvin 5.7
-
Field Summary
Modifier and TypeFieldDescriptionprotected final chemaxon.marvin.io.formats.MoleculeImporterIface
The wrapped importer. -
Constructor Summary
ConstructorDescriptionConstructs a new importer for the file.MoleculeImporter
(File f, String opts) Constructs a new importer for the file.MoleculeImporter
(InputStream inputStream) Constructs a new importer for the input stream.MoleculeImporter
(InputStream inputStream, String opts) Constructs a new importer for the stream.MoleculeImporter
(InputStream inputStream, String opts, String enc) Constructs a new importer for the stream.MoleculeImporter
(String fileName) Constructs a new importer for the file.MoleculeImporter
(String fileName, String opts) Constructs a new importer for the file. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface chemaxon.marvin.io.formats.MoleculeImporterIface
getMDocumentStream, getMolStream
-
Field Details
-
importer
protected final chemaxon.marvin.io.formats.MoleculeImporterIface importerThe wrapped importer. Created in the constructor, the interface methods delegates the functionality to this importer.
-
-
Constructor Details
-
MoleculeImporter
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
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
Constructs a new importer for the file.- Parameters:
f
- the file to import.- Throws:
IOException
- if an I/O error occurs.
-
MoleculeImporter
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
Constructs a new importer for the input stream.- Parameters:
inputStream
- the stream to import from.- Throws:
IOException
- if an I/O error occurs.
-
MoleculeImporter
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
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 Details
-
read
- Specified by:
read
in interfacechemaxon.marvin.io.formats.MoleculeImporterIface
- Throws:
IOException
-
getIterator
Returns an iterator that iterates through all molecules in the file/stream.- Returns:
- the iterator.
-
close
- Specified by:
close
in interfacechemaxon.marvin.io.formats.MoleculeImporterIface
- Throws:
IOException
-