1
/* $Revision: 7636 $ $Author: egonw $ $Date: 2007-01-04 18:46:10 +0100 (Thu, 04 Jan 2007) $
3
* Copyright (C) 2005-2007 Egon Willighagen <egonw@users.sf.net>
5
* Contact: cdk-devel@lists.sourceforge.net
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public License
9
* as published by the Free Software Foundation; either version 2.1
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
package org.openscience.cdk.debug;
23
import java.util.Hashtable;
25
import org.openscience.cdk.interfaces.IChemModel;
26
import org.openscience.cdk.interfaces.IChemObjectBuilder;
27
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
28
import org.openscience.cdk.interfaces.IChemObjectListener;
29
import org.openscience.cdk.interfaces.ICrystal;
30
import org.openscience.cdk.interfaces.IRingSet;
31
import org.openscience.cdk.interfaces.IMoleculeSet;
32
import org.openscience.cdk.interfaces.IReactionSet;
33
import org.openscience.cdk.tools.LoggingTool;
36
* Debugging data class.
39
* @cdk.module datadebug
41
public class DebugChemModel extends org.openscience.cdk.ChemModel
42
implements IChemModel {
44
private static final long serialVersionUID = -920209300005079592L;
46
LoggingTool logger = new LoggingTool(DebugChemModel.class);
48
public void addListener(IChemObjectListener col) {
49
logger.debug("Adding listener: ", col);
50
super.addListener(col);
53
public int getListenerCount() {
54
logger.debug("Getting listener count: ", super.getListenerCount());
55
return super.getListenerCount();
58
public void removeListener(IChemObjectListener col) {
59
logger.debug("Removing listener: ", col);
60
super.removeListener(col);
63
public void notifyChanged() {
64
logger.debug("Notifying changed");
65
super.notifyChanged();
68
public void notifyChanged(IChemObjectChangeEvent evt) {
69
logger.debug("Notifying changed event: ", evt);
70
super.notifyChanged(evt);
73
public void setProperty(Object description, Object property) {
74
logger.debug("Setting property: ", description + "=" + property);
75
super.setProperty(description, property);
78
public void removeProperty(Object description) {
79
logger.debug("Removing property: ", description);
80
super.removeProperty(description);
83
public Object getProperty(Object description) {
84
logger.debug("Getting property: ", description + "=" + super.getProperty(description));
85
return super.getProperty(description);
88
public Hashtable getProperties() {
89
logger.debug("Getting properties");
90
return super.getProperties();
93
public String getID() {
94
logger.debug("Getting ID: ", super.getID());
98
public void setID(String identifier) {
99
logger.debug("Setting ID: ", identifier);
100
super.setID(identifier);
103
public void setFlag(int flag_type, boolean flag_value) {
104
logger.debug("Setting flag: ", flag_type + "=" + flag_value);
105
super.setFlag(flag_type, flag_value);
108
public boolean getFlag(int flag_type) {
109
logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
110
return super.getFlag(flag_type);
113
public void setProperties(Hashtable properties) {
114
logger.debug("Setting properties: ", properties);
115
super.setProperties(properties);
118
public void setFlags(boolean[] flagsNew) {
119
logger.debug("Setting flags:", flagsNew.length);
120
super.setFlags(flagsNew);
123
public boolean[] getFlags() {
124
logger.debug("Getting flags:", super.getFlags().length);
125
return super.getFlags();
128
public Object clone() throws CloneNotSupportedException {
131
clone = super.clone();
132
} catch (Exception exception) {
133
logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
134
logger.debug(exception);
139
public IChemObjectBuilder getBuilder() {
140
return DebugChemObjectBuilder.getInstance();
143
public IMoleculeSet getMoleculeSet() {
144
logger.debug("Getting setOfMolecules: ", super.getMoleculeSet());
145
return super.getMoleculeSet();
148
public void setMoleculeSet(IMoleculeSet setOfMolecules) {
149
logger.debug("Setting setOfMolecules: ", setOfMolecules);
150
super.setMoleculeSet(setOfMolecules);
153
public IRingSet getRingSet() {
154
logger.debug("Getting ringSet: ", super.getRingSet());
155
return super.getRingSet();
158
public void setRingSet(IRingSet ringSet) {
159
logger.debug("Setting ringSet: ", ringSet);
160
super.setRingSet(ringSet);
163
public ICrystal getCrystal() {
164
logger.debug("Getting crystal: ", super.getCrystal());
165
return super.getCrystal();
168
public void setCrystal(ICrystal crystal) {
169
logger.debug("Setting crystal: ", crystal);
170
super.setCrystal(crystal);
173
public IReactionSet getReactionSet() {
174
logger.debug("Getting setOfReactions: ", super.getReactionSet());
175
return super.getReactionSet();
178
public void setReactionSet(IReactionSet sor) {
179
logger.debug("Setting setOfReactions: ", sor);
180
super.setReactionSet(sor);