~ubuntu-branches/ubuntu/maverick/cdk/maverick

« back to all changes in this revision

Viewing changes to src/org/openscience/cdk/debug/DebugReaction.java

  • Committer: Bazaar Package Importer
  • Author(s): Paul Cager
  • Date: 2008-04-09 21:17:53 UTC
  • Revision ID: james.westby@ubuntu.com-20080409211753-46lmjw5z8mx5pd8d
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Revision: 7636 $ $Author: egonw $ $Date: 2007-01-04 18:46:10 +0100 (Thu, 04 Jan 2007) $
 
2
 *
 
3
 * Copyright (C) 2005-2007  Egon Willighagen <egonw@users.sf.net>
 
4
 *
 
5
 * Contact: cdk-devel@lists.sourceforge.net
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
20
 */
 
21
package org.openscience.cdk.debug;
 
22
 
 
23
import java.util.Hashtable;
 
24
 
 
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;
 
32
 
 
33
/**
 
34
 * Debugging data class.
 
35
 * 
 
36
 * @author     egonw
 
37
 * @cdk.module datadebug
 
38
 */
 
39
public class DebugReaction extends org.openscience.cdk.Reaction
 
40
    implements IReaction {
 
41
 
 
42
    private static final long serialVersionUID = -8958358842308217875L;
 
43
    
 
44
    LoggingTool logger = new LoggingTool(DebugReaction.class);
 
45
 
 
46
    public DebugReaction() {
 
47
        super();
 
48
    }
 
49
 
 
50
    public void addListener(IChemObjectListener col) {
 
51
                logger.debug("Adding listener: ", col);
 
52
                super.addListener(col);
 
53
        }
 
54
 
 
55
        public int getListenerCount() {
 
56
                logger.debug("Getting listener count: ", super.getListenerCount());
 
57
                return super.getListenerCount();
 
58
        }
 
59
 
 
60
        public void removeListener(IChemObjectListener col) {
 
61
                logger.debug("Removing listener: ", col);
 
62
                super.removeListener(col);
 
63
        }
 
64
 
 
65
        public void notifyChanged() {
 
66
                logger.debug("Notifying changed");
 
67
                super.notifyChanged();
 
68
        }
 
69
 
 
70
        public void notifyChanged(IChemObjectChangeEvent evt) {
 
71
                logger.debug("Notifying changed event: ", evt);
 
72
                super.notifyChanged(evt);
 
73
        }
 
74
 
 
75
        public void setProperty(Object description, Object property) {
 
76
                logger.debug("Setting property: ", description + "=" + property);
 
77
                super.setProperty(description, property);
 
78
        }
 
79
 
 
80
        public void removeProperty(Object description) {
 
81
                logger.debug("Removing property: ", description);
 
82
                super.removeProperty(description);
 
83
        }
 
84
 
 
85
        public Object getProperty(Object description) {
 
86
                logger.debug("Getting property: ", description + "=" + super.getProperty(description));
 
87
                return super.getProperty(description);
 
88
        }
 
89
 
 
90
        public Hashtable getProperties() {
 
91
                logger.debug("Getting properties");
 
92
                return super.getProperties();
 
93
        }
 
94
 
 
95
        public String getID() {
 
96
                logger.debug("Getting ID: ", super.getID());
 
97
                return super.getID();
 
98
        }
 
99
 
 
100
        public void setID(String identifier) {
 
101
                logger.debug("Setting ID: ", identifier);
 
102
                super.setID(identifier);
 
103
        }
 
104
 
 
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);
 
108
        }
 
109
 
 
110
        public boolean getFlag(int flag_type) {
 
111
                logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
 
112
                return super.getFlag(flag_type);
 
113
        }
 
114
 
 
115
        public void setProperties(Hashtable properties) {
 
116
                logger.debug("Setting properties: ", properties);
 
117
                super.setProperties(properties);
 
118
        }
 
119
 
 
120
        public void setFlags(boolean[] flagsNew) {
 
121
                logger.debug("Setting flags:", flagsNew.length);
 
122
                super.setFlags(flagsNew);
 
123
        }
 
124
 
 
125
        public boolean[] getFlags() {
 
126
                logger.debug("Getting flags:", super.getFlags().length);
 
127
                return super.getFlags();
 
128
        }
 
129
 
 
130
        public Object clone() throws CloneNotSupportedException {
 
131
        Object clone = null;
 
132
        try {
 
133
                clone = super.clone();
 
134
        } catch (Exception exception) {
 
135
                logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
 
136
                logger.debug(exception);
 
137
        }
 
138
        return clone;
 
139
        }
 
140
 
 
141
        public IChemObjectBuilder getBuilder() {
 
142
                return DebugChemObjectBuilder.getInstance();
 
143
        }
 
144
 
 
145
        public int getReactantCount() {
 
146
                logger.debug("Getting reactant count: ", super.getReactantCount());
 
147
                return super.getReactantCount();
 
148
        }
 
149
 
 
150
        public int getProductCount() {
 
151
                logger.debug("Getting product count: ", super.getProductCount());
 
152
                return super.getProductCount();
 
153
        }
 
154
 
 
155
        public IMoleculeSet getReactants() {
 
156
                logger.debug("Getting reactants: ", super.getReactants());
 
157
                return super.getReactants();
 
158
        }
 
159
 
 
160
        public void setReactants(IMoleculeSet reactants) {
 
161
                logger.debug("Setting reactants: ", reactants);
 
162
                super.setReactants(reactants);
 
163
        }
 
164
 
 
165
        public IMoleculeSet getProducts() {
 
166
                logger.debug("Getting products: ", super.getProducts());
 
167
                return super.getProducts();
 
168
        }
 
169
 
 
170
        public void setProducts(IMoleculeSet products) {
 
171
                logger.debug("Setting products: ", products);
 
172
                super.setProducts(products);
 
173
        }
 
174
 
 
175
        public IMoleculeSet getAgents() {
 
176
                logger.debug("Getting agents: ", super.getAgents());
 
177
                return super.getAgents();
 
178
        }
 
179
 
 
180
        public void addReactant(IMolecule reactant) {
 
181
                logger.debug("Adding reactant: ", reactant);
 
182
                super.addReactant(reactant);
 
183
        }
 
184
 
 
185
        public void addAgent(IMolecule agent) {
 
186
                logger.debug("Adding agent: ", agent);
 
187
                super.addAgent(agent);
 
188
        }
 
189
 
 
190
        public void addReactant(IMolecule reactant, double coefficient) {
 
191
                logger.debug("Adding reactant with coefficient: ", reactant, ""+coefficient);
 
192
                super.addReactant(reactant, coefficient);
 
193
        }
 
194
 
 
195
        public void addProduct(IMolecule product) {
 
196
                logger.debug("Adding product: ", product);
 
197
                super.addProduct(product);
 
198
        }
 
199
 
 
200
        public void addProduct(IMolecule product, double coefficient) {
 
201
                logger.debug("Adding product with coefficient: ", product, ""+coefficient);
 
202
                super.addProduct(product, coefficient);
 
203
        }
 
204
 
 
205
        public double getReactantCoefficient(IMolecule reactant) {
 
206
                logger.debug("Setting reactant coefficient: ", reactant, ""+ super.getReactantCoefficient(reactant));
 
207
                return super.getReactantCoefficient(reactant);
 
208
        }
 
209
 
 
210
        public double getProductCoefficient(IMolecule product) {
 
211
                logger.debug("Setting product coefficient: ", product, ""+ super.getProductCoefficient(product));
 
212
                return super.getProductCoefficient(product);
 
213
        }
 
214
 
 
215
        public boolean setReactantCoefficient(IMolecule reactant, double coefficient) {
 
216
                logger.debug("Setting reactant coefficient: ", reactant, ""+coefficient);
 
217
                return super.setReactantCoefficient(reactant, coefficient);
 
218
        }
 
219
 
 
220
        public boolean setProductCoefficient(IMolecule product, double coefficient) {
 
221
                logger.debug("Setting product coefficient: ", product, ""+coefficient);
 
222
                return super.setProductCoefficient(product, coefficient);
 
223
        }
 
224
 
 
225
        public double[] getReactantCoefficients() {
 
226
                logger.debug("Getting reactant coefficients: ", super.getReactantCoefficients().length);
 
227
                return super.getReactantCoefficients();
 
228
        }
 
229
 
 
230
        public double[] getProductCoefficients() {
 
231
                logger.debug("Getting product coefficients: ", super.getProductCoefficients().length);
 
232
                return super.getProductCoefficients();
 
233
        }
 
234
 
 
235
        public boolean setReactantCoefficients(double[] coefficients) {
 
236
                logger.debug("Setting reactant coefficients: ", coefficients.length);
 
237
                return super.setReactantCoefficients(coefficients);
 
238
        }
 
239
 
 
240
        public boolean setProductCoefficients(double[] coefficients) {
 
241
                logger.debug("Setting product coefficients: ", coefficients.length);
 
242
                return super.setProductCoefficients(coefficients);
 
243
        }
 
244
 
 
245
        public void setDirection(int direction) {
 
246
                logger.debug("Setting direction: ", direction);
 
247
                super.setDirection(direction);
 
248
        }
 
249
 
 
250
        public int getDirection() {
 
251
                logger.debug("Getting direction: ", super.getDirection());
 
252
                return super.getDirection();
 
253
        }
 
254
 
 
255
}