~ubuntu-branches/ubuntu/trusty/cdk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/org/openscience/cdk/debug/DebugChemModel.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.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;
 
34
 
 
35
/**
 
36
 * Debugging data class.
 
37
 * 
 
38
 * @author     egonw
 
39
 * @cdk.module datadebug
 
40
 */
 
41
public class DebugChemModel extends org.openscience.cdk.ChemModel
 
42
    implements IChemModel {
 
43
 
 
44
    private static final long serialVersionUID = -920209300005079592L;
 
45
    
 
46
    LoggingTool logger = new LoggingTool(DebugChemModel.class);
 
47
 
 
48
        public void addListener(IChemObjectListener col) {
 
49
                logger.debug("Adding listener: ", col);
 
50
                super.addListener(col);
 
51
        }
 
52
 
 
53
        public int getListenerCount() {
 
54
                logger.debug("Getting listener count: ", super.getListenerCount());
 
55
                return super.getListenerCount();
 
56
        }
 
57
 
 
58
        public void removeListener(IChemObjectListener col) {
 
59
                logger.debug("Removing listener: ", col);
 
60
                super.removeListener(col);
 
61
        }
 
62
 
 
63
        public void notifyChanged() {
 
64
                logger.debug("Notifying changed");
 
65
                super.notifyChanged();
 
66
        }
 
67
 
 
68
        public void notifyChanged(IChemObjectChangeEvent evt) {
 
69
                logger.debug("Notifying changed event: ", evt);
 
70
                super.notifyChanged(evt);
 
71
        }
 
72
 
 
73
        public void setProperty(Object description, Object property) {
 
74
                logger.debug("Setting property: ", description + "=" + property);
 
75
                super.setProperty(description, property);
 
76
        }
 
77
 
 
78
        public void removeProperty(Object description) {
 
79
                logger.debug("Removing property: ", description);
 
80
                super.removeProperty(description);
 
81
        }
 
82
 
 
83
        public Object getProperty(Object description) {
 
84
                logger.debug("Getting property: ", description + "=" + super.getProperty(description));
 
85
                return super.getProperty(description);
 
86
        }
 
87
 
 
88
        public Hashtable getProperties() {
 
89
                logger.debug("Getting properties");
 
90
                return super.getProperties();
 
91
        }
 
92
 
 
93
        public String getID() {
 
94
                logger.debug("Getting ID: ", super.getID());
 
95
                return super.getID();
 
96
        }
 
97
 
 
98
        public void setID(String identifier) {
 
99
                logger.debug("Setting ID: ", identifier);
 
100
                super.setID(identifier);
 
101
        }
 
102
 
 
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);
 
106
        }
 
107
 
 
108
        public boolean getFlag(int flag_type) {
 
109
                logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
 
110
                return super.getFlag(flag_type);
 
111
        }
 
112
 
 
113
        public void setProperties(Hashtable properties) {
 
114
                logger.debug("Setting properties: ", properties);
 
115
                super.setProperties(properties);
 
116
        }
 
117
 
 
118
        public void setFlags(boolean[] flagsNew) {
 
119
                logger.debug("Setting flags:", flagsNew.length);
 
120
                super.setFlags(flagsNew);
 
121
        }
 
122
 
 
123
        public boolean[] getFlags() {
 
124
                logger.debug("Getting flags:", super.getFlags().length);
 
125
                return super.getFlags();
 
126
        }
 
127
 
 
128
        public Object clone() throws CloneNotSupportedException {
 
129
        Object clone = null;
 
130
        try {
 
131
                clone = super.clone();
 
132
        } catch (Exception exception) {
 
133
                logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
 
134
                logger.debug(exception);
 
135
        }
 
136
        return clone;
 
137
        }
 
138
 
 
139
        public IChemObjectBuilder getBuilder() {
 
140
                return DebugChemObjectBuilder.getInstance();
 
141
        }
 
142
 
 
143
        public IMoleculeSet getMoleculeSet() {
 
144
                logger.debug("Getting setOfMolecules: ", super.getMoleculeSet());
 
145
                return super.getMoleculeSet();
 
146
        }
 
147
 
 
148
        public void setMoleculeSet(IMoleculeSet setOfMolecules) {
 
149
                logger.debug("Setting setOfMolecules: ", setOfMolecules);
 
150
                super.setMoleculeSet(setOfMolecules);
 
151
        }
 
152
 
 
153
        public IRingSet getRingSet() {
 
154
                logger.debug("Getting ringSet: ", super.getRingSet());
 
155
                return super.getRingSet();
 
156
        }
 
157
 
 
158
        public void setRingSet(IRingSet ringSet) {
 
159
                logger.debug("Setting ringSet: ", ringSet);
 
160
                super.setRingSet(ringSet);
 
161
        }
 
162
 
 
163
        public ICrystal getCrystal() {
 
164
                logger.debug("Getting crystal: ", super.getCrystal());
 
165
                return super.getCrystal();
 
166
        }
 
167
 
 
168
        public void setCrystal(ICrystal crystal) {
 
169
                logger.debug("Setting crystal: ", crystal);
 
170
                super.setCrystal(crystal);
 
171
        }
 
172
 
 
173
        public IReactionSet getReactionSet() {
 
174
                logger.debug("Getting setOfReactions: ", super.getReactionSet());
 
175
                return super.getReactionSet();
 
176
        }
 
177
 
 
178
        public void setReactionSet(IReactionSet sor) {
 
179
                logger.debug("Setting setOfReactions: ", sor);
 
180
                super.setReactionSet(sor);
 
181
        }
 
182
 
 
183
}