Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.xmlcml.cmlimpl.topology
Class TopologyImpl  view TopologyImpl download TopologyImpl.java

java.lang.Object
  extended byPMRDocumentImpl
      extended byorg.xmlcml.cmlimpl.subset.SpanningTreeImpl
          extended byorg.xmlcml.cmlimpl.topology.TopologyImpl
All Implemented Interfaces:
org.w3c.dom.Document, org.w3c.dom.Node, org.xmlcml.cml.subset.SpanningTree, org.xmlcml.cml.topology.Topology

public class TopologyImpl
extends org.xmlcml.cmlimpl.subset.SpanningTreeImpl
implements org.xmlcml.cml.topology.Topology

Topology adapts a SpanningTree to have increased function for connection table analysis


Nested Class Summary
(package private) static class TopologyImpl.Primes
          generates prime numbers for uniquification
 class TopologyImpl.RankMap
           
 
Field Summary
protected  java.util.HashSet bondSetSet
           
protected  int chainCount
           
protected  java.util.Vector chainVector
           
protected  ChainSetImpl chMax
           
protected  int ringCount
           
protected  java.util.Vector ringNucleusVector
           
protected  java.util.Vector ringVector
           
protected  RingNucleusImpl rnMax
           
 
Fields inherited from class org.xmlcml.cmlimpl.subset.SpanningTreeImpl
acyclicBondSet, atomElementTable, bondSet, cyclicBondSet, cyclicBondVector, linkTable, linkVector, molecule, startingAtomSet, stElementVector, usedBondSet
 
Fields inherited from interface org.xmlcml.cml.subset.SpanningTree
RESTRUCTURE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
TopologyImpl()
           
TopologyImpl(org.xmlcml.cml.subset.BondSet bondSet, org.xmlcml.cml.CMLAtom rootAtom, org.xmlcml.cml.CMLAtom parentAtom)
           
TopologyImpl(org.xmlcml.cml.CMLMolecule molecule)
          adapter promotes SpanningTree to Toplogy; do not reuse sTree
TopologyImpl(org.xmlcml.cml.CMLMolecule molecule, org.xmlcml.cml.subset.AtomSet atomSet)
           
TopologyImpl(org.xmlcml.cml.CMLMolecule molecule, org.xmlcml.cml.CMLAtom atom)
           
 
Method Summary
 void addChainSet(org.xmlcml.cml.topology.ChainSet chain)
          this adds an *existing* chain to the vector (i.e.
(package private)  void addSubstituents(org.xmlcml.cml.subset.BondSet bs, java.util.HashSet bondSetSet)
           
 void calculateCoordinates(boolean update)
           
 void calculateTopology(boolean update)
          get all cyclic bonds after spanning tree is created.
(package private)  void findChains()
          find the chains
 void findRingNuclei()
           
 void findRings()
           
(package private)  java.util.HashMap getAtomInvariants(org.xmlcml.cml.subset.AtomSet atomSet)
           
 org.xmlcml.cml.topology.ChainSet[] getChainList()
          get chains
 java.util.Vector getChainVector()
           
(package private)  java.lang.String getInvariant(org.xmlcml.cml.CMLAtom atom)
           
(package private)  java.util.HashMap getRankedMap(java.util.ArrayList list)
           
 org.xmlcml.cml.topology.Ring[] getRingList()
          get rings
 org.xmlcml.cml.topology.RingNucleus[] getRingNucleusList()
          get ringNuclei
 java.util.Vector getRingNucleusVector()
          get all cyclic bonds after spanning tree is created.
 java.util.Vector getRingVector()
          get rings
 java.util.TreeMap getUniqueNumbering()
          get unique numbering (cf.
static void main(java.lang.String[] args)
           
(package private)  void removeOverlaps()
           
private  void storeBonds(java.util.Vector atomVector, int count, org.xmlcml.cml.topology.Ring ring)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
(package private)  void updateCoordinates(org.xmlcml.cml.subset.BondSet bondSet)
           
 
Methods inherited from class org.xmlcml.cmlimpl.subset.SpanningTreeImpl
addAtom, addLink, createSpanningTreeVector, getAcyclicAtomSet, getAcyclicBondSet, getAtomAncestorVector, getAtomElementTable, getAtomSet, getBondSet, getCyclicAtomSet, getCyclicBondSet, getLinkVector, getMolecule, getNonRingAtomSet, getSTElement, getSTElementVector, makeRootElement, processSpTreeVector, toSMILES
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xmlcml.cml.subset.SpanningTree
addAtom, addLink, getAcyclicAtomSet, getAcyclicBondSet, getAtomAncestorVector, getAtomElementTable, getAtomSet, getBondSet, getCyclicAtomSet, getCyclicBondSet, getLinkVector, getMolecule, getNonRingAtomSet, getSTElementVector, toSMILES
 
Methods inherited from interface org.w3c.dom.Document
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Field Detail

ringCount

protected int ringCount

ringNucleusVector

protected java.util.Vector ringNucleusVector

chainCount

protected int chainCount

chainVector

protected java.util.Vector chainVector

ringVector

protected java.util.Vector ringVector

rnMax

protected RingNucleusImpl rnMax

chMax

protected ChainSetImpl chMax

bondSetSet

protected java.util.HashSet bondSetSet
Constructor Detail

TopologyImpl

public TopologyImpl()

TopologyImpl

public TopologyImpl(org.xmlcml.cml.CMLMolecule molecule)
             throws org.xmlcml.cml.CMLException
adapter promotes SpanningTree to Toplogy; do not reuse sTree


TopologyImpl

public TopologyImpl(org.xmlcml.cml.CMLMolecule molecule,
                    org.xmlcml.cml.CMLAtom atom)
             throws org.xmlcml.cml.CMLException

TopologyImpl

public TopologyImpl(org.xmlcml.cml.CMLMolecule molecule,
                    org.xmlcml.cml.subset.AtomSet atomSet)
             throws org.xmlcml.cml.CMLException

TopologyImpl

public TopologyImpl(org.xmlcml.cml.subset.BondSet bondSet,
                    org.xmlcml.cml.CMLAtom rootAtom,
                    org.xmlcml.cml.CMLAtom parentAtom)
             throws org.xmlcml.cml.CMLException
Method Detail

findRings

public void findRings()
               throws org.xmlcml.cml.CMLException

storeBonds

private void storeBonds(java.util.Vector atomVector,
                        int count,
                        org.xmlcml.cml.topology.Ring ring)
                 throws org.xmlcml.cml.CMLException

calculateTopology

public void calculateTopology(boolean update)
                       throws org.xmlcml.cml.CMLException
get all cyclic bonds after spanning tree is created.

Specified by:
calculateTopology in interface org.xmlcml.cml.topology.Topology

calculateCoordinates

public void calculateCoordinates(boolean update)

removeOverlaps

void removeOverlaps()

updateCoordinates

void updateCoordinates(org.xmlcml.cml.subset.BondSet bondSet)

addSubstituents

void addSubstituents(org.xmlcml.cml.subset.BondSet bs,
                     java.util.HashSet bondSetSet)

getRingVector

public java.util.Vector getRingVector()
get rings


getRingList

public org.xmlcml.cml.topology.Ring[] getRingList()
get rings


getRingNucleusVector

public java.util.Vector getRingNucleusVector()
                                      throws org.xmlcml.cml.CMLException
get all cyclic bonds after spanning tree is created.

Specified by:
getRingNucleusVector in interface org.xmlcml.cml.topology.Topology

getRingNucleusList

public org.xmlcml.cml.topology.RingNucleus[] getRingNucleusList()
                                                         throws org.xmlcml.cml.CMLException
get ringNuclei

Specified by:
getRingNucleusList in interface org.xmlcml.cml.topology.Topology

getChainVector

public java.util.Vector getChainVector()
                                throws org.xmlcml.cml.CMLException
Specified by:
getChainVector in interface org.xmlcml.cml.topology.Topology

getChainList

public org.xmlcml.cml.topology.ChainSet[] getChainList()
                                                throws org.xmlcml.cml.CMLException
get chains

Specified by:
getChainList in interface org.xmlcml.cml.topology.Topology

findChains

void findChains()
          throws org.xmlcml.cml.CMLException
find the chains


findRingNuclei

public void findRingNuclei()
                    throws org.xmlcml.cml.CMLException

addChainSet

public void addChainSet(org.xmlcml.cml.topology.ChainSet chain)
this adds an *existing* chain to the vector (i.e. does not create it). Called from Chain()

Specified by:
addChainSet in interface org.xmlcml.cml.topology.Topology

getUniqueNumbering

public java.util.TreeMap getUniqueNumbering()
get unique numbering (cf. Weininger)

Specified by:
getUniqueNumbering in interface org.xmlcml.cml.topology.Topology

getRankedMap

java.util.HashMap getRankedMap(java.util.ArrayList list)

getAtomInvariants

java.util.HashMap getAtomInvariants(org.xmlcml.cml.subset.AtomSet atomSet)

getInvariant

java.lang.String getInvariant(org.xmlcml.cml.CMLAtom atom)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


main

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