org.xmlcml.tools
Class SpanningTreeImpl

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.tools.SpanningTreeImpl

public class SpanningTreeImpl
extends PMRDocumentImpl
implements SpanningTree

See Also:
Serialized Form

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 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
SpanningTreeImpl()
           
SpanningTreeImpl(Molecule molecule)
          new spanning tree, starting at first atom and including all its descendants
SpanningTreeImpl(Molecule molecule, Atom start)
          new spanning tree, starting at start and including all its descendants
SpanningTreeImpl(Molecule molecule, Atom rootAtom, Atom parentAtom)
          new spanning tree, starting at rootAtom.
 
Method Summary
 STElement addAtom(STElement parentElement, Atom atom)
          create new STElement (contains atom) and add to parent
 void addChainSet(ChainSet chain)
          this adds an *existing* chain to the vector (i.e.
 void addLink(Bond bond)
          add link - check if bond alreay used and create vector if null
 void calculateTopology()
          get all cyclic bonds after spanning tree is created.
 void findRingNuclei()
           
 void findRings()
           
 AtomSet getAcyclicAtomSet()
          get atoms in acyclic bonds
 BondSet getAcyclicBondSet()
          get bonds not in rings
 AtomSet getAtomSet()
          get atoms
 BondSet getBondSet()
          get bonds
 AtomSet getCyclicAtomSet()
          get atoms only in rings
 BondSet getCyclicBondSet()
          get bonds in rings
 java.util.Vector getLinkVector()
           
 Molecule getMolecule()
           
 AtomSet getNonRingAtomSet()
          get atoms not in rings
 java.util.Vector getRingNucleusVector()
          get all cyclic bonds after spanning tree is created.
 java.util.Vector getRingVector()
          get rings
 STElement getSTElement(Atom atom)
           
static void main(java.lang.String[] args)
           
 java.lang.String toSMILES()
           
 java.lang.String toString()
           
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpanningTreeImpl

public SpanningTreeImpl()

SpanningTreeImpl

public SpanningTreeImpl(Molecule molecule,
                        Atom rootAtom,
                        Atom parentAtom)
                 throws CMLException
new spanning tree, starting at rootAtom. Do not include parent and its descendants (unless reached by other routes). If parent == null, explore all atoms connected to start

SpanningTreeImpl

public SpanningTreeImpl(Molecule molecule,
                        Atom start)
                 throws CMLException
new spanning tree, starting at start and including all its descendants

SpanningTreeImpl

public SpanningTreeImpl(Molecule molecule)
                 throws CMLException
new spanning tree, starting at first atom and including all its descendants
Method Detail

getMolecule

public Molecule getMolecule()
Specified by:
getMolecule in interface SpanningTree

getLinkVector

public java.util.Vector getLinkVector()
Specified by:
getLinkVector in interface SpanningTree

getBondSet

public BondSet getBondSet()
get bonds
Specified by:
getBondSet in interface SpanningTree

getCyclicBondSet

public BondSet getCyclicBondSet()
get bonds in rings
Specified by:
getCyclicBondSet in interface SpanningTree

getAcyclicBondSet

public BondSet getAcyclicBondSet()
get bonds not in rings
Specified by:
getAcyclicBondSet in interface SpanningTree

getAtomSet

public AtomSet getAtomSet()
get atoms
Specified by:
getAtomSet in interface SpanningTree

getNonRingAtomSet

public AtomSet getNonRingAtomSet()
get atoms not in rings
Specified by:
getNonRingAtomSet in interface SpanningTree

getCyclicAtomSet

public AtomSet getCyclicAtomSet()
get atoms only in rings
Specified by:
getCyclicAtomSet in interface SpanningTree

getAcyclicAtomSet

public AtomSet getAcyclicAtomSet()
get atoms in acyclic bonds
Specified by:
getAcyclicAtomSet in interface SpanningTree

addAtom

public STElement addAtom(STElement parentElement,
                         Atom atom)
Description copied from interface: SpanningTree
create new STElement (contains atom) and add to parent
Specified by:
addAtom in interface SpanningTree

getSTElement

public STElement getSTElement(Atom atom)

addLink

public void addLink(Bond bond)
add link - check if bond alreay used and create vector if null
Specified by:
addLink in interface SpanningTree

findRings

public void findRings()
               throws CMLException

calculateTopology

public void calculateTopology()
                       throws CMLException
get all cyclic bonds after spanning tree is created.
Specified by:
calculateTopology in interface SpanningTree

getRingVector

public java.util.Vector getRingVector()
get rings

getRingNucleusVector

public java.util.Vector getRingNucleusVector()
                                      throws CMLException
get all cyclic bonds after spanning tree is created.
Specified by:
getRingNucleusVector in interface SpanningTree

findRingNuclei

public void findRingNuclei()
                    throws CMLException

addChainSet

public void addChainSet(ChainSet chain)
this adds an *existing* chain to the vector (i.e. does not create it). Called from Chain()
Specified by:
addChainSet in interface SpanningTree

toSMILES

public java.lang.String toSMILES()
                          throws CMLException
Specified by:
toSMILES in interface SpanningTree

toString

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

main

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