@PublicAPI public class MoleculeImporter extends java.lang.Object implements chemaxon.marvin.io.formats.MoleculeImporterIface
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.
Modifier and Type | Field and Description |
---|---|
protected chemaxon.marvin.io.formats.MoleculeImporterIface |
importer
The wrapped importer.
|
Constructor and Description |
---|
MoleculeImporter(java.io.File f)
Constructs a new importer for the file.
|
MoleculeImporter(java.io.File f,
java.lang.String opts)
Constructs a new importer for the file.
|
MoleculeImporter(java.io.InputStream inputStream)
Constructs a new importer for the input stream.
|
MoleculeImporter(java.io.InputStream inputStream,
java.lang.String opts)
Constructs a new importer for the stream.
|
MoleculeImporter(java.io.InputStream inputStream,
java.lang.String opts,
java.lang.String enc)
Constructs a new importer for the stream.
|
MoleculeImporter(java.lang.String fileName)
Constructs a new importer for the file.
|
MoleculeImporter(java.lang.String fileName,
java.lang.String opts)
Constructs a new importer for the file.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.util.Iterator<Molecule> |
getIterator()
Returns an iterator that iterates through all molecules in the file/stream.
|
Molecule |
read() |
protected final chemaxon.marvin.io.formats.MoleculeImporterIface importer
public MoleculeImporter(java.lang.String fileName) throws java.io.IOException
fileName
- the name of the file to import.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.lang.String fileName, java.lang.String opts) throws java.io.IOException
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.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.io.File f) throws java.io.IOException
f
- the file to import.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.io.File f, java.lang.String opts) throws java.io.IOException
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.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- the stream to import from.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.io.InputStream inputStream, java.lang.String opts) throws java.io.IOException
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.java.io.IOException
- if an I/O error occurs.public MoleculeImporter(java.io.InputStream inputStream, java.lang.String opts, java.lang.String enc) throws java.io.IOException
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.java.io.IOException
- if an I/O error occurs.public Molecule read() throws java.io.IOException
read
in interface chemaxon.marvin.io.formats.MoleculeImporterIface
java.io.IOException
public java.util.Iterator<Molecule> getIterator()
public void close() throws java.io.IOException
close
in interface chemaxon.marvin.io.formats.MoleculeImporterIface
java.io.IOException