Logo Search packages:      
Sourcecode: cdk version File versions  Download package

DebugRing.java

/* $Revision$ $Author$ $Date$
 *
 * Copyright (C) 2005-2007  Egon Willighagen <egonw@users.sf.net>
 *
 * Contact: cdk-devel@lists.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package org.openscience.cdk.debug;

import java.util.List;
import java.util.Map;

import org.openscience.cdk.Bond;
import org.openscience.cdk.Ring;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomParity;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
import org.openscience.cdk.interfaces.IChemObjectListener;
import org.openscience.cdk.interfaces.IElectronContainer;
import org.openscience.cdk.interfaces.ILonePair;
import org.openscience.cdk.interfaces.IRing;
import org.openscience.cdk.interfaces.ISingleElectron;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.tools.LoggingTool;

/**
 * Debugging data class.
 * 
 * @author     egonw
 * @cdk.module datadebug
 * @cdk.githash
 */
00049 public class DebugRing extends Ring
    implements IRing {

00052     private static final long serialVersionUID = -6420813246421544803L;
    
    LoggingTool logger = new LoggingTool(DebugRing.class);

      public DebugRing() {
            super();
      }
    
      public DebugRing(int ringSize, String elementSymbol) {
            this(ringSize);
            super.atomCount = ringSize;
            super.bondCount = ringSize;
            atoms[0] = new DebugAtom(elementSymbol);
            for (int i = 1; i < ringSize; i++) {
                  atoms[i] = new DebugAtom(elementSymbol);
                  super.bonds[i-1] = new Bond(atoms[i - 1], atoms[i], IBond.Order.SINGLE);
            }
            super.bonds[ringSize-1] = new Bond(atoms[ringSize - 1], atoms[0], IBond.Order.SINGLE);
      }
      
      public DebugRing(int ringSize) {
            super(ringSize);
      }

      public DebugRing(IAtomContainer container) {
            super(container);
      }

00080       public void addAtomParity(IAtomParity parity) {
            logger.debug("Adding atom parity: ", parity);
            super.addAtomParity(parity);
      }

00085       public IAtomParity getAtomParity(IAtom atom) {
            logger.debug("Getting atom parity: ", atom);
            return super.getAtomParity(atom);
      }

00090       public void setAtoms(IAtom[] atoms) {
            logger.debug("Setting atoms: ", atoms.length);
            super.setAtoms(atoms);
      }

//    public void setElectronContainers(IElectronContainer[] electronContainers) {
//          logger.debug("Setting electron containers: ", electronContainers.length);
//          super.setElectronContainers(electronContainers);
//    }

00100       public void setAtom(int number, IAtom atom) {
            logger.debug("Setting atom at: pos=" + number, " atom=" + atom);
            super.setAtom(number, atom);
      }

00105       public IAtom getAtom(int number) {
            logger.debug("Getting atom at: ", number);
            return super.getAtom(number);
      }

00110       public IBond getBond(int number) {
            logger.debug("Getting bond at: ", number);
            return super.getBond(number);
      }

00115       public ILonePair getLonePair(int number) {
            logger.debug("Getting lone pair at: ", number);
            return super.getLonePair(number);
      }
      
00120       public ISingleElectron getSingleElectron(int number) {
            logger.debug("Getting single electron at: ", number);
            return super.getSingleElectron(number);
      }
      
//    public void setElectronContainer(int number, IElectronContainer electronContainer) {
//          logger.debug("Setting electron container at: pos=" + number, " electron container=" +electronContainer);
//          super.setElectronContainer(number, electronContainer);
//    }

//    public void setElectronContainerCount(int electronContainerCount) {
//          logger.debug("Setting electron container count: ", electronContainerCount);
//          super.setElectronContainerCount(electronContainerCount);
//    }

//    public void setAtomCount(int atomCount) {
//          logger.debug("Settting atom count: ", atomCount);
//          super.setAtomCount(atomCount);
//    }

00140     public Iterable<IAtom> atoms() {
        logger.debug("Getting atoms iterator");
        return super.atoms();
    }

00145       public Iterable<IBond> bonds() {
            logger.debug("Getting bonds iterator");
            return super.bonds();
      }
      
00150       public Iterable<ILonePair> lonePairs() {
            logger.debug("Getting lone pairs iterator");
            return super.lonePairs();
      }

00155       public Iterable<ISingleElectron> singleElectrons() {
            logger.debug("Getting single electrons iterator");
            return super.singleElectrons();
      }

00160       public Iterable<IElectronContainer> electronContainers() {
            logger.debug("Getting electron containers iterator");
            return super.electronContainers();
      }
      
00165       public IAtom getFirstAtom() {
            logger.debug("Getting first atom: ", super.getFirstAtom());
            return super.getFirstAtom();
      }

00170       public IAtom getLastAtom() {
            logger.debug("Getting last atom: ", super.getLastAtom());
            return super.getLastAtom();
      }

00175       public int getAtomNumber(IAtom atom) {
            logger.debug("Getting atom number: ", atom);
            return super.getAtomNumber(atom);
      }

00180       public int getBondNumber(IAtom atom1, IAtom atom2) {
            logger.debug("Getting bond number: atom1=" + atom1, " atom2=" + atom2);
            return super.getBondNumber(atom1, atom2);
      }

00185       public int getBondNumber(IBond bond) {
            logger.debug("Getting bond number: ", bond);
            return super.getBondNumber(bond);
      }

00190       public int getLonePairNumber(ILonePair bond) {
            logger.debug("Getting lone pair number: ", bond);
            return super.getLonePairNumber(bond);
      }
      
00195       public int getSingleElectronNumber(ISingleElectron bond) {
            logger.debug("Getting single electron number: ", bond);
            return super.getSingleElectronNumber(bond);
      }
      
00200       public IElectronContainer getElectronContainer(int number) {
            logger.debug("Getting electron container at: ", number);
            return super.getElectronContainer(number);
      }

00205       public IBond getBond(IAtom atom1, IAtom atom2) {
            logger.debug("Getting bond for atoms: atom1=" + atom1, " atom2=" + atom2);
            return super.getBond(atom1, atom2);
      }
      
00210       public int getAtomCount() {
            logger.debug("Getting atom count");
            return super.getAtomCount();
      }

00215       public int getBondCount() {
            logger.debug("Getting bond count");
            return super.getBondCount();
      }
      
00220       public int getLonePairCount() {
            logger.debug("Getting lone pair count");
            return super.getLonePairCount();
      }

00225       public int getSingleElectronCount() {
            logger.debug("Getting single electron count");
            return super.getSingleElectronCount();
      }
      
00230       public int getElectronContainerCount() {
            logger.debug("Getting electron container count");
            return super.getElectronContainerCount();
      }

      
//    public IAtom[] getConnectedAtoms(IAtom atom) {
//          logger.debug("Getting connected atoms for atom: ", atom);
//          return super.getConnectedAtoms(atom);
//    }

00241       public List getConnectedAtomsList(IAtom atom) {
            logger.debug("Getting connecting atoms vector for atom: ", atom);
            return super.getConnectedAtomsList(atom);
      }

//    public IBond[] getConnectedBonds(IAtom atom) {
//          logger.debug("Getting connected bonds for atom: ", atom);
//          return super.getConnectedBonds(atom);
//    }

00251       public List getConnectedBondsList(IAtom atom) {
            logger.debug("Getting connected bonds vector for atom: ", atom);
            return super.getConnectedBondsList(atom);
      }

00256       public List getConnectedLonePairsList(IAtom atom) {
            logger.debug("Getting lone pairs at atom: atom=" + atom, " lone pairs=" + super.getConnectedLonePairsCount(atom));
            return super.getConnectedLonePairsList(atom);
      }
      
00261       public List getConnectedSingleElectronsList(IAtom atom) {
            logger.debug("Getting single electrons at atom: atom=" + atom, " single electrons=" + super.getConnectedSingleElectronsCount(atom));
            return super.getConnectedSingleElectronsList(atom);
      }
      
00266       public java.util.List getConnectedElectronContainersList(IAtom atom) {
            logger.debug("Getting connected electron containers for atom: ", atom);
            return super.getConnectedElectronContainersList(atom);
      }

00271       public int getConnectedAtomsCount(IAtom atom) {
            logger.debug("Getting connected atoms count for atom: ", atom);
            return super.getConnectedAtomsCount(atom);
      }
      
00276       public int getConnectedBondsCount(IAtom atom) {
            logger.debug("Getting connected bonds count for atom: ", atom);
            return super.getConnectedBondsCount(atom);
      }
      
00281       public int getConnectedLonePairsCount(IAtom atom) {
            logger.debug("Getting connected lone pairs count for atom: ", atom);
            return super.getConnectedLonePairsCount(atom);
      }
      
00286       public int getConnectedSingleElectronsCount(IAtom atom) {
            logger.debug("Getting connected single electrons count for atom: ", atom);
            return super.getConnectedSingleElectronsCount(atom);
      }
      
00291       public double getBondOrderSum(IAtom atom) {
            logger.debug("Getting bond order sum for atom: ", atom);
            return super.getBondOrderSum(atom);
      }

00296       public Order getMaximumBondOrder(IAtom atom) {
            logger.debug("Getting maximum bond order for atom: ", atom);
            return super.getMaximumBondOrder(atom);
      }

00301       public Order getMinimumBondOrder(IAtom atom) {
            logger.debug("Getting minimum bond order for atom: ", atom);
            return super.getMinimumBondOrder(atom);
      }

//    public void addElectronContainers(IAtomContainer atomContainer) {
//          logger.debug("Adding electron containers from atom container: ", atomContainer);
//          super.addElectronContainers(atomContainer);
//    }

00311       public void add(IAtomContainer atomContainer) {
            logger.debug("Adding atom container: ", atomContainer);
            super.add(atomContainer);
      }

00316       public void addAtom(IAtom atom) {
            logger.debug("Adding atom: ", atom);
            super.addAtom(atom);
      }

00321       public void addBond(IBond bond) {
            logger.debug("Adding bond: ", bond);
            super.addBond(bond);
      }

00326       public void addLonePair(ILonePair ec) {
            logger.debug("Adding lone pair: ", ec);
            super.addLonePair(ec);
      }
      
00331       public void addSingleElectron(ISingleElectron ec) {
            logger.debug("Adding single electron: ", ec);
            super.addSingleElectron(ec);
      }
      
00336       public void addElectronContainer(IElectronContainer electronContainer) {
            logger.debug("Adding electron container: ", electronContainer);
            super.addElectronContainer(electronContainer);
      }

00341       public void remove(IAtomContainer atomContainer) {
            logger.debug("Removing atom container: ", atomContainer);
            super.remove(atomContainer);
      }

00346       public IElectronContainer removeElectronContainer(int position) {
            logger.debug("Removing electronContainer: ", position);
            return super.removeElectronContainer(position);
      }

00351       public void removeElectronContainer(IElectronContainer electronContainer) {
            logger.debug("Removing electron container: ", electronContainer);
            super.removeElectronContainer(electronContainer);
      }

00356       public void removeAtom(int position) {
            logger.debug("Removing atom: ", position);
            super.removeAtom(position);
      }

00361       public void removeAtom(IAtom atom) {
            logger.debug("Removing atom: ", atom);
            super.removeAtom(atom);
      }

00366       public IBond removeBond(int pos) {
            logger.debug("Removing bond at " + pos);
            return super.removeBond(pos);
      }
      
00371       public IBond removeBond(IAtom atom1, IAtom atom2) {
            logger.debug("Removing bond: atom1=" + atom1 + " atom2=" + atom2);
            return super.removeBond(atom1, atom2);
      }
      
00376       public void removeBond(IBond bond) {
            logger.debug("Removing bond=" + bond);
            super.removeBond(bond);
      }
      
00381       public ILonePair removeLonePair(int pos) {
            logger.debug("Removing bond at " + pos);
            return super.removeLonePair(pos);
      }
      
00386       public void removeLonePair(ILonePair ec) {
            logger.debug("Removing bond=" + ec);
            super.removeLonePair(ec);
      }
      
00391       public ISingleElectron removeSingleElectron(int pos) {
            logger.debug("Removing bond at " + pos);
            return super.removeSingleElectron(pos);
      }
      
00396       public void removeSingleElectron(ISingleElectron ec) {
            logger.debug("Removing bond=" + ec);
            super.removeSingleElectron(ec);
      }
      
00401       public void removeAtomAndConnectedElectronContainers(IAtom atom) {
            logger.debug("Removing atom and connected electron containers: ", atom);
            super.removeAtomAndConnectedElectronContainers(atom);       
      }
      
00406       public void removeAllElements() {
            logger.debug("Removing all elements");
            super.removeAllElements();
      }

00411       public void removeAllElectronContainers() {
            logger.debug("Removing all electron containers");
            super.removeAllElectronContainers();
      }

00416       public void removeAllBonds() {
            logger.debug("Removing all bonds");
            super.removeAllBonds();
      }

00421       public void addBond(int atom1, int atom2, IBond.Order order, int stereo) {
            logger.debug("Adding bond: atom1=" + atom1 + " atom2=" + atom2, " order=" + order + " stereo=" + stereo);
            super.addBond(atom1, atom2, order, stereo);
      }

00426       public void addBond(int atom1, int atom2, IBond.Order order) {
            logger.debug("Adding bond: atom1=" + atom1 + " atom2=" + atom2, " order=" + order);
            super.addBond(atom1, atom2, order);
      }

00431       public void addLonePair(int atomID) {
            logger.debug("Adding lone pair: ", atomID);
            super.addLonePair(atomID);
      }

00436       public void addSingleElectron(int atomID) {
            logger.debug("Adding single electron: ", atomID);
            super.addSingleElectron(atomID);
      }
      
00441       public boolean contains(IAtom atom) {
            logger.debug("Contains atom: ", atom);
            return super.contains(atom);
      }

00446       public boolean contains(IBond bond) {
            logger.debug("Contains bond: ", bond);
            return super.contains(bond);
      }
      
00451       public boolean contains(ILonePair ec) {
            logger.debug("Contains lone pair: ", ec);
            return super.contains(ec);
      }
      
00456       public boolean contains(ISingleElectron ec) {
            logger.debug("Contains single electron: ", ec);
            return super.contains(ec);
      }
      
00461       public boolean contains(IElectronContainer electronContainer) {
            logger.debug("Contains electron container: ", electronContainer);
            return super.contains(electronContainer);
      }

00466       public void addListener(IChemObjectListener col) {
            logger.debug("Adding listener: ", col);
            super.addListener(col);
      }

00471       public int getListenerCount() {
            logger.debug("Getting listener count: ", super.getListenerCount());
            return super.getListenerCount();
      }

00476       public void removeListener(IChemObjectListener col) {
            logger.debug("Removing listener: ", col);
            super.removeListener(col);
      }

00481       public void notifyChanged() {
            logger.debug("Notifying changed");
            super.notifyChanged();
      }

00486       public void notifyChanged(IChemObjectChangeEvent evt) {
            logger.debug("Notifying changed event: ", evt);
            super.notifyChanged(evt);
      }

00491       public void setProperty(Object description, Object property) {
            logger.debug("Setting property: ", description + "=" + property);
            super.setProperty(description, property);
      }

00496       public void removeProperty(Object description) {
            logger.debug("Removing property: ", description);
            super.removeProperty(description);
      }

00501       public Object getProperty(Object description) {
            logger.debug("Getting property: ", description + "=" + super.getProperty(description));
            return super.getProperty(description);
      }

00506       public Map<Object,Object> getProperties() {
            logger.debug("Getting properties");
            return super.getProperties();
      }

00511       public String getID() {
            logger.debug("Getting ID: ", super.getID());
            return super.getID();
      }

00516       public void setID(String identifier) {
            logger.debug("Setting ID: ", identifier);
            super.setID(identifier);
      }

00521       public void setFlag(int flag_type, boolean flag_value) {
            logger.debug("Setting flag: ", flag_type + "=" + flag_value);
            super.setFlag(flag_type, flag_value);
      }

00526       public boolean getFlag(int flag_type) {
            logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
            return super.getFlag(flag_type);
      }

00531       public void setProperties(Map<Object,Object> properties) {
            logger.debug("Setting properties: ", properties);
            super.setProperties(properties);
      }

00536       public void setFlags(boolean[] flagsNew) {
            logger.debug("Setting flags:", flagsNew.length);
            super.setFlags(flagsNew);
      }

00541       public boolean[] getFlags() {
            logger.debug("Getting flags:", super.getFlags().length);
            return super.getFlags();
      }

00546       public Object clone() throws CloneNotSupportedException {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (Exception exception) {
            logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
            logger.debug(exception);
        }
        return clone;
      }

00557       public IChemObjectBuilder getBuilder() {
            return DebugChemObjectBuilder.getInstance();
      }

00561       public int getRingSize() {
            logger.debug("Getting Ring size:", super.getRingSize());
            return super.getRingSize();
      }

00566       public IBond getNextBond(IBond bond, IAtom atom) {
            logger.debug("Getting next bond: ", super.getNextBond(bond, atom));
            return super.getNextBond(bond, atom);
      }

00571       public int getBondOrderSum() {
            logger.debug("Getting order sum: ", super.getBondOrderSum());
            return super.getBondOrderSum();
      }

00576       public void stateChanged(IChemObjectChangeEvent event) {
            logger.debug("State changed: ", event);
            super.stateChanged(event);
      }

}

Generated by  Doxygen 1.6.0   Back to index