chemaxon.marvin.io.formats.mdl
Class MolExport

java.lang.Object
  extended by chemaxon.marvin.io.MolExportModule
      extended by chemaxon.marvin.io.formats.mdl.MolExport
All Implemented Interfaces:
StereoConstants

public class MolExport
extends MolExportModule
implements StereoConstants

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

Since:
Marvin 1.2.3
Version:
5.0.7, 07/24/2008
Author:
Peter Csizmadia, Szabolcs Csepregi, Erika Biro

Field Summary
 
Fields inherited from class chemaxon.marvin.io.MolExportModule
aromatize, stringBuffer
 
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
MolExport()
          Constructor.
 
Method Summary
protected  void appendMEnd(Molecule mol)
          Appends the "M END" line to the string buffer.
 java.lang.Object convert(Molecule mol)
          Creates an MDL mol or compressed mol representation of the molecule.
protected  void convertCoordinateBondsToData(Molecule mol)
          Converts coordinate bonds to data sgroups (attached data) with field name MRV_COORDINATE_BOND.
protected  void convertMultiCenterSgroupsToData(Molecule mol)
          Converts the multicenter sgroups to data sgroups in the molecule.
protected  void convertPageSettingsToData(Molecule mol)
          Converts page setting of multipage molecular document to data sgroups (attached data) with field name MRV_PAGE_XXX.
protected  int getMolfileVersion()
          Gets the molfile version.
protected  void getOptionDescriptors(java.lang.String fmtname, java.lang.String optnames, java.util.List l)
          Gets the option descriptors.
 java.lang.Object open(java.lang.String fmtopts)
          Open the exporter stream.
protected  int parseOption(java.lang.String opts, int i)
          Parses the bond length (b###) option.
 
Methods inherited from class chemaxon.marvin.io.MolExportModule
addData, appendChars, appendLeft, appendRight, appendRight, close, getEncoding, getFormat, getOptionDescriptors, getOptionDescriptors, getOptions, getOptionSign, isCleanable, isDocumentExport, isImplicitHcountImportant, isImplicitHcountImportant, isSupportedEncoding, open, parseCharIfOptionSign, preconvert, preconvert, preconvert, preconvert, setEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MolExport

public MolExport()
Constructor. Sets the current date.

Method Detail

getOptionDescriptors

protected void getOptionDescriptors(java.lang.String fmtname,
                                    java.lang.String optnames,
                                    java.util.List l)
Gets the option descriptors.

Overrides:
getOptionDescriptors in class MolExportModule
Parameters:
fmtname - the format name or null
optnames - option names or null for all
l - the output list
Since:
Marvin 5.0, 06/06/2007

open

public java.lang.Object open(java.lang.String fmtopts)
                      throws MolExportException
Open the exporter stream.

Overrides:
open in class MolExportModule
Parameters:
fmtopts - output file format and options
Returns:
the head of the file for RDF, null otherwise
Throws:
MolExportException - Invalid format string.
See Also:
MolExportModule.getFormat(), MolExportModule.getOptions()

parseOption

protected int parseOption(java.lang.String opts,
                          int i)
                   throws java.lang.IllegalArgumentException
Parses the bond length (b###) option.

Overrides:
parseOption in class MolExportModule
Parameters:
opts - the options string
i - the current index
Returns:
index of the next option, or i if the current option is unknown
Throws:
java.lang.IllegalArgumentException - in case of parsing error

convert

public java.lang.Object convert(Molecule mol)
                         throws MolExportException
Creates an MDL mol or compressed mol representation of the molecule.

Specified by:
convert in class MolExportModule
Parameters:
mol - the molecule
Returns:
a string containing the molfile
Throws:
MolExportException - cannot be converted to MDL molfile

getMolfileVersion

protected int getMolfileVersion()
Gets the molfile version.

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

appendMEnd

protected void appendMEnd(Molecule mol)
Appends the "M END" line to the string buffer.

Parameters:
mol - the molecule

convertMultiCenterSgroupsToData

protected void convertMultiCenterSgroupsToData(Molecule mol)
Converts the multicenter sgroups to data sgroups in the molecule.

Parameters:
mol - the molecule that contains the sgroups to convert

convertPageSettingsToData

protected void convertPageSettingsToData(Molecule mol)
Converts page setting of multipage molecular document to data sgroups (attached data) with field name MRV_PAGE_XXX. The data is attached to the first atom.

Parameters:
mol - molecule to convert
Since:
Marvin 4.1 02/14/2006

convertCoordinateBondsToData

protected void convertCoordinateBondsToData(Molecule mol)
Converts coordinate bonds to data sgroups (attached data) with field name MRV_COORDINATE_BOND. The data is attached to the first atom.

Parameters:
mol - molecule to convert
Since:
Marvin 5.0 15/07/2007