org.xmlcml.cml
Class BondImpl

java.lang.Object
  |
  +--org.apache.xerces.dom.NodeImpl
        |
        +--org.apache.xerces.dom.ChildNode
              |
              +--org.apache.xerces.dom.ChildAndParentNode
                    |
                    +--org.apache.xerces.dom.ElementImpl
                          |
                          +--uk.co.demon.ursus.dom.AbstractElementImpl
                                |
                                +--uk.co.demon.ursus.dom.PMRElementImpl
                                      |
                                      +--org.xmlcml.cml.CMLBaseImpl
                                            |
                                            +--org.xmlcml.cml.AbstractBuiltinContainerImpl
                                                  |
                                                  +--org.xmlcml.cml.AbstractBondImpl
                                                        |
                                                        +--org.xmlcml.cml.BondImpl

public class BondImpl
extends AbstractBondImpl
implements Bond

See Also:
Serialized Form

Field Summary
protected  Atom[] atomRefs
           
protected  double length
           
protected  Molecule molecule
           
protected  java.lang.String order
           
protected  java.lang.String stereo
           
 
Fields inherited from class org.xmlcml.cml.AbstractBondImpl
atomRefVector
 
Fields inherited from class org.xmlcml.cml.AbstractBuiltinContainerImpl
builtinValues, nonBuiltinTable
 
Fields inherited from class org.xmlcml.cml.CMLBaseImpl
conventionName, conventionTable, dictRef, id, title, validity
 
Fields inherited from class uk.co.demon.ursus.dom.PMRElementImpl
CLASSNAME, processFlag
 
Fields inherited from class uk.co.demon.ursus.dom.AbstractElementImpl
CLASSNAME
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ChildAndParentNode
changes, firstChild, nodeListIndex, nodeListLength, nodeListNode, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
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.cml.AbstractBond
AROMATIC, ATOMREF, ATOMREFS, BOND_BUILTIN_COUNT, BOND_FLOATVAL_COUNT, BOND_FLOATVAL_END, BOND_FLOATVAL_START, BOND_INTEGERVAL_COUNT, BOND_INTEGERVAL_END, BOND_INTEGERVAL_START, BOND_STRINGVAL_COUNT, BOND_STRINGVAL_END, BOND_STRINGVAL_START, bondOrders, bondTypeStrings, DECREASE, DEFAULTXY2LENGTH, DEFAULTXYZ3LENGTH, DELETE, DOUBLE, HATCH, INCREASE, LENGTH, NOSTEREO, ORDER, OVERRUN, SINGLE, STEREO, TRIPLE, WEDGE, ZERO
 
Fields inherited from interface org.xmlcml.cml.AbstractBuiltinContainer
NONUNIQUE, UNIQUE
 
Fields inherited from interface org.xmlcml.cml.CMLBase
ANGLE, ATOM, ATOMARRAY, BOND, BONDARRAY, BUILTIN, CML, CRYSTAL, ELECTRON, ELEMENT_COUNT, ELEMENT_NAMES, EXECUTE, FEATURE, FLOAT, FLOAT_TYPE, FLOATARRAY, FLOATMATRIX, FORMULA, INTEGER, INTEGER_TYPE, INTEGERARRAY, LINK, LIST, MOLECULE, PACKAGE_NAME, REACTION, SEQUENCE, STRING, STRING_TYPE, STRINGARRAY, TORSION, UNK, UNK_ELEM, UNKNOWN
 
Fields inherited from interface uk.co.demon.ursus.dom.PMRElement
CLASSNAME, LOCAL, QUALIFIED, UNIVERSAL
 
Fields inherited from interface org.xmlcml.cml.HasTitle
TITLE
 
Fields inherited from interface org.xmlcml.cml.HasDictRef
DICTREF
 
Fields inherited from interface org.xmlcml.cml.HasId
ID
 
Fields inherited from interface org.xmlcml.cml.HasConvention
CONVENTION
 
Fields inherited from interface uk.co.demon.ursus.dom.PMRNode
ATTRIBUTES, CONTENT, ELEMENTNAME, IDLIST, NESTED, NESTEDATTS, PACKAGENAME, PRETTY, SPLITFILES, STYLE, TAGGED, UNTAGGED, WHITESPACE, XMLCONTENT
 
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
 
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
BondImpl()
           
BondImpl(Atom atom1, Atom atom2)
          new Bond formed from atoms, in context but no other info Atoms must belong to the same non-null Molecule
BondImpl(org.w3c.dom.Document document)
          new BondImpl in context
BondImpl(org.w3c.dom.Element element)
           
 
Method Summary
protected static java.lang.String atomHash(Atom atom1, Atom atom2)
           
 boolean contains(Atom atom)
          true if bond contains this atom
 void debug(java.io.Writer w)
          output debug info to Writer
 Atom getAtom(int i)
           
 double getBondLength()
           
 Molecule getMolecule()
          every Bond should be associated with one molecule
 java.lang.String getOrder()
           
 Atom getOtherAtom(Atom atom)
          returns other atom in a 2-atom bond else null
 java.lang.String getStereo()
           
 StringVal getStringVal(int i)
           
 java.lang.String hashKey()
           
 void processAtomRefs(Molecule molecule)
          give each atom an ID.
 void processDOM()
          carries out class-specific processing for subclasses of PMRElement.
 void setBondLength(double length)
           
protected  void setMolecule(Molecule molecule)
          every Bond should be associated with one molecule
 void setOrder(java.lang.String order)
           
 void setStereo(java.lang.String stereo)
           
 void setStringVal(int i, StringVal stringVal)
           
 java.lang.String toString()
           
 void updateDOM()
           
 
Methods inherited from class org.xmlcml.cml.AbstractBondImpl
addAtomRef, deleteAtomRef, getAtomRef, getAtomRefVector, getBuiltinCount, getBuiltinFloatValCount, getBuiltinFloatValNames, getBuiltinIntegerValCount, getBuiltinIntegerValNames, getBuiltinNames, getBuiltinStringValCount, getBuiltinStringValNames, getValidity, showBuiltinNames
 
Methods inherited from class org.xmlcml.cml.AbstractBuiltinContainerImpl
addBuiltinChildWithFloatValue, addBuiltinChildWithIntegerValue, addBuiltinChildWithStringValue, checkBuiltins, deleteNonBuiltinVal, getBuiltinChildElements, getBuiltinChildFloatValue, getBuiltinChildIntegerValue, getBuiltinChildStringValue, getBuiltinVal, getNonBuiltinVal, setBuiltinVal, setNonBuiltinVal
 
Methods inherited from class org.xmlcml.cml.CMLBaseImpl
addValidity, convertToSubclass, getConventionName, getDictRef, getId, getSubClassedElement, getTitle, help, isValid, main, setConventionName, setDictRef, setId, setTitle, showElementNames, test1, updateDOMHasConvention, updateDOMHasConvention, updateDOMHasCount, updateDOMHasDictRef, updateDOMHasDictRef, updateDOMHasId, updateDOMHasId, updateDOMHasTitle, updateDOMHasTitle, updateDOMHasUnits
 
Methods inherited from class uk.co.demon.ursus.dom.PMRElementImpl
appendTo, initialise, processDescendants, setProcessFlag
 
Methods inherited from class uk.co.demon.ursus.dom.AbstractElementImpl
setTagName
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getTagName, hasAttribute, hasAttributeNS, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setReadOnly, setupDefaultAttributes, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ChildAndParentNode
changed, changes, getChildNodes, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, insertBefore, item, removeChild, replaceChild, synchronizeChildren, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, dispatchEvent, finalize, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, removeEventListener, setNodeValue, setPrefix, setUserData, supports
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

atomRefs

protected Atom[] atomRefs

molecule

protected Molecule molecule

length

protected double length

order

protected java.lang.String order

stereo

protected java.lang.String stereo
Constructor Detail

BondImpl

public BondImpl()

BondImpl

public BondImpl(org.w3c.dom.Element element)

BondImpl

public BondImpl(org.w3c.dom.Document document)
new BondImpl in context

BondImpl

public BondImpl(Atom atom1,
                Atom atom2)
         throws CMLException
new Bond formed from atoms, in context but no other info Atoms must belong to the same non-null Molecule
Method Detail

setMolecule

protected void setMolecule(Molecule molecule)
every Bond should be associated with one molecule

getMolecule

public Molecule getMolecule()
every Bond should be associated with one molecule
Specified by:
getMolecule in interface Bond

getBondLength

public double getBondLength()
                     throws CMLException
Specified by:
getBondLength in interface Bond

setBondLength

public void setBondLength(double length)
Specified by:
setBondLength in interface Bond

getOrder

public java.lang.String getOrder()
                          throws CMLException
Specified by:
getOrder in interface Bond

setOrder

public void setOrder(java.lang.String order)
Specified by:
setOrder in interface Bond

getStereo

public java.lang.String getStereo()
                           throws CMLException
Specified by:
getStereo in interface Bond

setStereo

public void setStereo(java.lang.String stereo)
Specified by:
setStereo in interface Bond

getStringVal

public StringVal getStringVal(int i)
Specified by:
getStringVal in interface Bond

setStringVal

public void setStringVal(int i,
                         StringVal stringVal)
Specified by:
setStringVal in interface Bond

getAtom

public Atom getAtom(int i)
Specified by:
getAtom in interface Bond

getOtherAtom

public Atom getOtherAtom(Atom atom)
returns other atom in a 2-atom bond else null
Specified by:
getOtherAtom in interface Bond

contains

public boolean contains(Atom atom)
true if bond contains this atom
Specified by:
contains in interface Bond

processAtomRefs

public void processAtomRefs(Molecule molecule)
                     throws CMLException
give each atom an ID. Order is: id attribute, atomId builtin child, then serial
Specified by:
processAtomRefs in interface Bond

processDOM

public void processDOM()
                throws CMLException
Description copied from interface: PMRElement
carries out class-specific processing for subclasses of PMRElement. The default for a generic PMRElement is no-op. Often creates an internal model
Overrides:
processDOM in class CMLBaseImpl
Tags copied from class: PMRElementImpl
Throws:
java.lang.Exception - these can be of many kinds and may include class-specific ones

updateDOM

public void updateDOM()
               throws CMLException
Overrides:
updateDOM in class CMLBaseImpl

atomHash

protected static java.lang.String atomHash(Atom atom1,
                                           Atom atom2)

hashKey

public java.lang.String hashKey()
Specified by:
hashKey in interface Bond

toString

public java.lang.String toString()
Overrides:
toString in class org.apache.xerces.dom.NodeImpl

debug

public void debug(java.io.Writer w)
           throws java.io.IOException
output debug info to Writer
Overrides:
debug in class CMLBaseImpl
Parameters:
Writer - w output