org.xmlcml.noncml
Class MDLMolImpl

java.lang.Object
  |
  +--org.apache.xerces.dom.NodeImpl
        |
        +--org.apache.xerces.dom.ParentNode
              |
              +--org.apache.xerces.dom.DocumentImpl
                    |
                    +--uk.co.demon.ursus.dom.AbstractDocumentImpl
                          |
                          +--uk.co.demon.ursus.dom.PMRDocumentImpl
                                |
                                +--org.xmlcml.cml.CMLDocumentImpl
                                      |
                                      +--org.xmlcml.noncml.NonCMLDocumentImpl
                                            |
                                            +--org.xmlcml.noncml.MDLMolImpl

public class MDLMolImpl
extends NonCMLDocumentImpl
implements MDLMol

class to read (? and write?) mdl-molfiles as described in chemical MIME.

NOTE: I have not been able to find any public statement of the format and am unable to guarantee the correctness of any code which interprets Mol files.

See Also:
Serialized Form

Fields inherited from class org.xmlcml.noncml.NonCMLDocumentImpl
atomList, atomParent, bondList, bondParent, bReader, inputCML, inputCMLMolecule, line, natoms, nbonds, outputCML, outputCMLMolecule
 
Fields inherited from class uk.co.demon.ursus.dom.AbstractDocumentImpl
DEFAULT_PARSER_NAME, docElement
 
Fields inherited from class org.apache.xerces.dom.DocumentImpl
allowGrammarAccess, docElement, docType, errorChecking, identifiers, iterators, kidOK, ranges, treeWalkers, userData
 
Fields inherited from class org.apache.xerces.dom.ParentNode
changes, firstChild, nodeListIndex, nodeListLength, nodeListNode, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, IGNORABLEWS, MUTATION_AGGREGATE, MUTATION_ALL, MUTATION_LOCAL, MUTATION_NONE, MUTATIONEVENTS, OWNED, ownerNode, READONLY, SETVALUE, SPECIFIED, SYNCCHILDREN, SYNCDATA
 
Fields inherited from interface org.xmlcml.noncml.NonCMLDocument
JME, MDLMOL, SDF, SMILES, XYZ
 
Fields inherited from interface org.xmlcml.cml.CMLDocument
PACKAGE_NAME
 
Fields inherited from interface uk.co.demon.ursus.dom.PMRDocument
PACKAGENAME
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
MDLMolImpl()
           
MDLMolImpl(java.io.BufferedReader bReader, java.lang.String id)
          form a MDLMol object from a local file
MDLMolImpl(Molecule outputCMLMolecule)
          form a MDLMol object from a CML file
 
Method Summary
static java.lang.String cmlBondOrder(int molNumber)
          translates MDL bond orders into JUMBO-MOL orders
static java.lang.String cmlStereoBond(int molNumber)
          translates MDL numbers into JUMBO-MOL codes
 void input(java.io.BufferedReader bReader)
          input from a Reader.
static void main(java.lang.String[] args)
           
static int molBondOrder(java.lang.String cmlCode)
          translates "CML"-MOL codes into MDL numbers
static int molBondStereo(java.lang.String cmlCode)
          translates JUMBO-MOL codes into MDL numbers
 java.lang.String output(java.io.Writer writer)
          outputs Molecule as an MDLMofile if possible.
 void setOutputCMLMolecule(Molecule outputCMLMolecule)
          to output a CML-Molecule in legacy form the molecule must be added to the NonCMLDocument and then the output() method called
 java.lang.String writeAtoms(java.io.Writer writer)
           
 java.lang.String writeBonds(java.io.Writer writer)
           
 java.lang.String writeFooter(java.io.Writer writer)
           
 java.lang.String writeHeader(java.io.Writer writer)
           
 
Methods inherited from class org.xmlcml.noncml.NonCMLDocumentImpl
createCMLElement, createMoleculeElement
 
Methods inherited from class org.xmlcml.cml.CMLDocumentImpl
createCMLDocument, createCMLDocument, debug, getMolecule, test1
 
Methods inherited from class uk.co.demon.ursus.dom.PMRDocumentImpl
createDocument, createDocument, testBuild, testRead
 
Methods inherited from class org.apache.xerces.dom.DocumentImpl
adoptNode, clone, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElement, createElementDefinition, createElementNS, createEntity, createEntityReference, createEvent, createNodeIterator, createNodeIterator, createNotation, createProcessingInstruction, createRange, createTextNode, createTreeWalker, createTreeWalker, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getErrorChecking, getIdentifier, getIdentifiers, getImplementation, getNodeIterators, getNodeName, getNodeType, getOwnerDocument, getRanges, getTreeWalkers, getUserData, importNode, insertBefore, isKidOK, isXMLName, putIdentifier, removeChild, removeIdentifier, removeTreeWalker, setErrorChecking, setUserData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
changed, changes, getChildNodes, getFirstChild, getLastChild, getLength, hasChildNodes, item, normalize, replaceChild, setReadOnly, synchronizeChildren, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, dispatchEvent, finalize, getAttributes, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getReadOnly, getUserData, removeEventListener, setNodeValue, setPrefix, setUserData, supports, synchronizeData, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MDLMolImpl

public MDLMolImpl()

MDLMolImpl

public MDLMolImpl(java.io.BufferedReader bReader,
                  java.lang.String id)
           throws java.io.IOException,
                  CMLException
form a MDLMol object from a local file
Throws:
java.lang.Exception - file was not a standard MDLMol file

MDLMolImpl

public MDLMolImpl(Molecule outputCMLMolecule)
form a MDLMol object from a CML file
Method Detail

setOutputCMLMolecule

public void setOutputCMLMolecule(Molecule outputCMLMolecule)
Description copied from interface: NonCMLDocument
to output a CML-Molecule in legacy form the molecule must be added to the NonCMLDocument and then the output() method called

input

public void input(java.io.BufferedReader bReader)
           throws java.io.IOException,
                  CMLException
Description copied from interface: NonCMLDocument
input from a Reader. If the String value is to be input, use a StringReader. This could be used immediately after a default constructor and may be used in the class constructors

molBondOrder

public static int molBondOrder(java.lang.String cmlCode)
translates "CML"-MOL codes into MDL numbers

cmlBondOrder

public static java.lang.String cmlBondOrder(int molNumber)
translates MDL bond orders into JUMBO-MOL orders

molBondStereo

public static int molBondStereo(java.lang.String cmlCode)
translates JUMBO-MOL codes into MDL numbers

cmlStereoBond

public static java.lang.String cmlStereoBond(int molNumber)
translates MDL numbers into JUMBO-MOL codes

output

public java.lang.String output(java.io.Writer writer)
                        throws CMLException,
                               java.io.IOException
outputs Molecule as an MDLMofile if possible. This is NOT a faithful representation as I haven't read the spec completely
Parameters:
Writer - writer to output it to

writeHeader

public java.lang.String writeHeader(java.io.Writer writer)
                             throws CMLException,
                                    java.io.IOException

writeAtoms

public java.lang.String writeAtoms(java.io.Writer writer)
                            throws CMLException,
                                   java.io.IOException

writeBonds

public java.lang.String writeBonds(java.io.Writer writer)
                            throws CMLException,
                                   java.io.IOException

writeFooter

public java.lang.String writeFooter(java.io.Writer writer)
                             throws CMLException,
                                    java.io.IOException

main

public static void main(java.lang.String[] args)