chemaxon.marvin.io.formats.mdl
Class MolImport

java.lang.Object
  extended bychemaxon.marvin.io.MolImportModule
      extended bychemaxon.marvin.io.formats.mdl.MolImport
All Implemented Interfaces:
StereoConstants

public class MolImport
extends MolImportModule
implements StereoConstants

Imports MDL Molfile, SDfile, RGfile, RDfile, Rxnfile and (ChemAxon) compressed molfile. In the Molfiles documentation, you can find details about import options.

Since:
Marvin 1.3
Version:
5.1, 07/30/2008
Author:
Peter Csizmadia, Szabolcs Csepregi, Erika Biro

Field Summary
 
Fields inherited from interface chemaxon.struc.StereoConstants
ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_MASK, CHIRALITY_R, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, TRANS
 
Constructor Summary
MolImport()
           
 
Method Summary
 Molecule createMol()
          Creates a new target molecule object.
protected  int getMolfileVersion()
          Gets the molfile version.
 void initMolImport(MolInputStream is)
          Initializes the import module.
 boolean readMol(Molecule mol)
          Reads a molecule from MDL mol/sdf/rxn file.
 void setOptions(java.lang.String opts)
          Sets the import options.
 
Methods inherited from class chemaxon.marvin.io.MolImportModule
isDocumentImporter, readDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MolImport

public MolImport()
Method Detail

setOptions

public void setOptions(java.lang.String opts)
Sets the import options.

Overrides:
setOptions in class MolImportModule
Parameters:
opts - import options

initMolImport

public void initMolImport(MolInputStream is)
                   throws MolFormatException,
                          java.io.IOException
Initializes the import module.

Specified by:
initMolImport in class MolImportModule
Parameters:
is - the molecule input stream
Throws:
MolFormatException - if the file cannot be read because of a molecule file format related error
java.io.IOException - an I/O error occured while reading the file

readMol

public boolean readMol(Molecule mol)
                throws MolFormatException,
                       java.io.IOException
Reads a molecule from MDL mol/sdf/rxn file. All the nodes, edges, and properties are removed from mol before reading.

Specified by:
readMol in class MolImportModule
Parameters:
mol - the molecule object to read into
Returns:
true after successfully reading the molecule, false if no more molecule found
Throws:
MolFormatException - if the file is in bad format
java.io.IOException - in case of I/O error

createMol

public Molecule createMol()
Creates a new target molecule object.

Specified by:
createMol in class MolImportModule
Returns:
new Molecule, RgMolecule or RxnMolecule
Since:
Marvin 3.4, 05/08/2004

getMolfileVersion

protected int getMolfileVersion()
Gets the molfile version.

Returns:
2 or 3
Since:
Marvin 3.4.1, 07/16/2004