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.IChemObjectBuilder;
26
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
27
import org.openscience.cdk.interfaces.IChemObjectListener;
28
import org.openscience.cdk.interfaces.IMolecule;
29
import org.openscience.cdk.interfaces.IReaction;
30
import org.openscience.cdk.interfaces.IMoleculeSet;
31
import org.openscience.cdk.tools.LoggingTool;
34
* Debugging data class.
37
* @cdk.module datadebug
39
public class DebugReaction extends org.openscience.cdk.Reaction
40
implements IReaction {
42
private static final long serialVersionUID = -8958358842308217875L;
44
LoggingTool logger = new LoggingTool(DebugReaction.class);
46
public DebugReaction() {
50
public void addListener(IChemObjectListener col) {
51
logger.debug("Adding listener: ", col);
52
super.addListener(col);
55
public int getListenerCount() {
56
logger.debug("Getting listener count: ", super.getListenerCount());
57
return super.getListenerCount();
60
public void removeListener(IChemObjectListener col) {
61
logger.debug("Removing listener: ", col);
62
super.removeListener(col);
65
public void notifyChanged() {
66
logger.debug("Notifying changed");
67
super.notifyChanged();
70
public void notifyChanged(IChemObjectChangeEvent evt) {
71
logger.debug("Notifying changed event: ", evt);
72
super.notifyChanged(evt);
75
public void setProperty(Object description, Object property) {
76
logger.debug("Setting property: ", description + "=" + property);
77
super.setProperty(description, property);
80
public void removeProperty(Object description) {
81
logger.debug("Removing property: ", description);
82
super.removeProperty(description);
85
public Object getProperty(Object description) {
86
logger.debug("Getting property: ", description + "=" + super.getProperty(description));
87
return super.getProperty(description);
90
public Hashtable getProperties() {
91
logger.debug("Getting properties");
92
return super.getProperties();
95
public String getID() {
96
logger.debug("Getting ID: ", super.getID());
100
public void setID(String identifier) {
101
logger.debug("Setting ID: ", identifier);
102
super.setID(identifier);
105
public void setFlag(int flag_type, boolean flag_value) {
106
logger.debug("Setting flag: ", flag_type + "=" + flag_value);
107
super.setFlag(flag_type, flag_value);
110
public boolean getFlag(int flag_type) {
111
logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
112
return super.getFlag(flag_type);
115
public void setProperties(Hashtable properties) {
116
logger.debug("Setting properties: ", properties);
117
super.setProperties(properties);
120
public void setFlags(boolean[] flagsNew) {
121
logger.debug("Setting flags:", flagsNew.length);
122
super.setFlags(flagsNew);
125
public boolean[] getFlags() {
126
logger.debug("Getting flags:", super.getFlags().length);
127
return super.getFlags();
130
public Object clone() throws CloneNotSupportedException {
133
clone = super.clone();
134
} catch (Exception exception) {
135
logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
136
logger.debug(exception);
141
public IChemObjectBuilder getBuilder() {
142
return DebugChemObjectBuilder.getInstance();
145
public int getReactantCount() {
146
logger.debug("Getting reactant count: ", super.getReactantCount());
147
return super.getReactantCount();
150
public int getProductCount() {
151
logger.debug("Getting product count: ", super.getProductCount());
152
return super.getProductCount();
155
public IMoleculeSet getReactants() {
156
logger.debug("Getting reactants: ", super.getReactants());
157
return super.getReactants();
160
public void setReactants(IMoleculeSet reactants) {
161
logger.debug("Setting reactants: ", reactants);
162
super.setReactants(reactants);
165
public IMoleculeSet getProducts() {
166
logger.debug("Getting products: ", super.getProducts());
167
return super.getProducts();
170
public void setProducts(IMoleculeSet products) {
171
logger.debug("Setting products: ", products);
172
super.setProducts(products);
175
public IMoleculeSet getAgents() {
176
logger.debug("Getting agents: ", super.getAgents());
177
return super.getAgents();
180
public void addReactant(IMolecule reactant) {
181
logger.debug("Adding reactant: ", reactant);
182
super.addReactant(reactant);
185
public void addAgent(IMolecule agent) {
186
logger.debug("Adding agent: ", agent);
187
super.addAgent(agent);
190
public void addReactant(IMolecule reactant, double coefficient) {
191
logger.debug("Adding reactant with coefficient: ", reactant, ""+coefficient);
192
super.addReactant(reactant, coefficient);
195
public void addProduct(IMolecule product) {
196
logger.debug("Adding product: ", product);
197
super.addProduct(product);
200
public void addProduct(IMolecule product, double coefficient) {
201
logger.debug("Adding product with coefficient: ", product, ""+coefficient);
202
super.addProduct(product, coefficient);
205
public double getReactantCoefficient(IMolecule reactant) {
206
logger.debug("Setting reactant coefficient: ", reactant, ""+ super.getReactantCoefficient(reactant));
207
return super.getReactantCoefficient(reactant);
210
public double getProductCoefficient(IMolecule product) {
211
logger.debug("Setting product coefficient: ", product, ""+ super.getProductCoefficient(product));
212
return super.getProductCoefficient(product);
215
public boolean setReactantCoefficient(IMolecule reactant, double coefficient) {
216
logger.debug("Setting reactant coefficient: ", reactant, ""+coefficient);
217
return super.setReactantCoefficient(reactant, coefficient);
220
public boolean setProductCoefficient(IMolecule product, double coefficient) {
221
logger.debug("Setting product coefficient: ", product, ""+coefficient);
222
return super.setProductCoefficient(product, coefficient);
225
public double[] getReactantCoefficients() {
226
logger.debug("Getting reactant coefficients: ", super.getReactantCoefficients().length);
227
return super.getReactantCoefficients();
230
public double[] getProductCoefficients() {
231
logger.debug("Getting product coefficients: ", super.getProductCoefficients().length);
232
return super.getProductCoefficients();
235
public boolean setReactantCoefficients(double[] coefficients) {
236
logger.debug("Setting reactant coefficients: ", coefficients.length);
237
return super.setReactantCoefficients(coefficients);
240
public boolean setProductCoefficients(double[] coefficients) {
241
logger.debug("Setting product coefficients: ", coefficients.length);
242
return super.setProductCoefficients(coefficients);
245
public void setDirection(int direction) {
246
logger.debug("Setting direction: ", direction);
247
super.setDirection(direction);
250
public int getDirection() {
251
logger.debug("Getting direction: ", super.getDirection());
252
return super.getDirection();