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

« back to all changes in this revision

Viewing changes to src/org/openscience/cdk/debug/DebugMolecule.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
import java.util.List;
 
25
 
 
26
import org.openscience.cdk.interfaces.IAtom;
 
27
import org.openscience.cdk.interfaces.IAtomContainer;
 
28
import org.openscience.cdk.interfaces.IAtomParity;
 
29
import org.openscience.cdk.interfaces.IBond;
 
30
import org.openscience.cdk.interfaces.IChemObjectBuilder;
 
31
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
 
32
import org.openscience.cdk.interfaces.IChemObjectListener;
 
33
import org.openscience.cdk.interfaces.IElectronContainer;
 
34
import org.openscience.cdk.interfaces.ILonePair;
 
35
import org.openscience.cdk.interfaces.IMolecule;
 
36
import org.openscience.cdk.interfaces.ISingleElectron;
 
37
import org.openscience.cdk.tools.LoggingTool;
 
38
 
 
39
/**
 
40
 * Debugging data class.
 
41
 * 
 
42
 * @author     egonw
 
43
 * @cdk.module datadebug
 
44
 */
 
45
public class DebugMolecule extends org.openscience.cdk.Molecule
 
46
    implements IMolecule {
 
47
 
 
48
    private static final long serialVersionUID = -7263404200270132412L;
 
49
    
 
50
    LoggingTool logger = new LoggingTool(DebugMolecule.class);
 
51
 
 
52
        public DebugMolecule() {
 
53
                super();
 
54
        }
 
55
 
 
56
        public DebugMolecule(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
 
57
                super(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
 
58
        }
 
59
 
 
60
        public DebugMolecule(IAtomContainer container) {
 
61
                super(container);
 
62
        }
 
63
 
 
64
        public void addAtomParity(IAtomParity parity) {
 
65
                logger.debug("Adding atom parity: ", parity);
 
66
                super.addAtomParity(parity);
 
67
        }
 
68
 
 
69
        public IAtomParity getAtomParity(IAtom atom) {
 
70
                logger.debug("Getting atom parity: ", atom);
 
71
                return super.getAtomParity(atom);
 
72
        }
 
73
 
 
74
        public void setAtoms(IAtom[] atoms) {
 
75
                logger.debug("Setting atoms: ", atoms.length);
 
76
                super.setAtoms(atoms);
 
77
        }
 
78
 
 
79
//      public void setElectronContainers(IElectronContainer[] electronContainers) {
 
80
//              logger.debug("Setting electron containers: ", electronContainers.length);
 
81
//              super.setElectronContainers(electronContainers);
 
82
//      }
 
83
 
 
84
        public void setAtom(int number, IAtom atom) {
 
85
                logger.debug("Setting atom at: pos=" + number, " atom=" + atom);
 
86
                super.setAtom(number, atom);
 
87
        }
 
88
 
 
89
        public IAtom getAtom(int number) {
 
90
                logger.debug("Getting atom at: ", number);
 
91
                return super.getAtom(number);
 
92
        }
 
93
 
 
94
        public IBond getBond(int number) {
 
95
                logger.debug("Getting bond at: ", number);
 
96
                return super.getBond(number);
 
97
        }
 
98
 
 
99
        public ILonePair getLonePair(int number) {
 
100
                logger.debug("Getting lone pair at: ", number);
 
101
                return super.getLonePair(number);
 
102
        }
 
103
        
 
104
        public ISingleElectron getSingleElectron(int number) {
 
105
                logger.debug("Getting single electron at: ", number);
 
106
                return super.getSingleElectron(number);
 
107
        }
 
108
        
 
109
//      public void setElectronContainer(int number, IElectronContainer electronContainer) {
 
110
//              logger.debug("Setting electron container at: pos=" + number, " electron container=" +electronContainer);
 
111
//              super.setElectronContainer(number, electronContainer);
 
112
//      }
 
113
 
 
114
//      public void setElectronContainerCount(int electronContainerCount) {
 
115
//              logger.debug("Setting electron container count: ", electronContainerCount);
 
116
//              super.setElectronContainerCount(electronContainerCount);
 
117
//      }
 
118
 
 
119
//      public void setAtomCount(int atomCount) {
 
120
//              logger.debug("Settting atom count: ", atomCount);
 
121
//              super.setAtomCount(atomCount);
 
122
//      }
 
123
 
 
124
        public java.util.Iterator atoms() {
 
125
                logger.debug("Getting atoms iterator");
 
126
                return super.atoms();
 
127
        }
 
128
        
 
129
        public java.util.Iterator bonds() {
 
130
                logger.debug("Getting bonds iterator");
 
131
                return super.bonds();
 
132
        }
 
133
        
 
134
        public java.util.Iterator lonePairs() {
 
135
                logger.debug("Getting lone pairs iterator");
 
136
                return super.lonePairs();
 
137
        }
 
138
        
 
139
        public java.util.Iterator singleElectrons() {
 
140
                logger.debug("Getting single electrons iterator");
 
141
                return super.singleElectrons();
 
142
        }
 
143
        
 
144
        public java.util.Iterator electronContainers() {
 
145
                logger.debug("Getting electron containers iterator");
 
146
                return super.electronContainers();
 
147
        }
 
148
 
 
149
        public IAtom getFirstAtom() {
 
150
                logger.debug("Getting first atom: ", super.getFirstAtom());
 
151
                return super.getFirstAtom();
 
152
        }
 
153
 
 
154
        public IAtom getLastAtom() {
 
155
                logger.debug("Getting last atom: ", super.getLastAtom());
 
156
                return super.getLastAtom();
 
157
        }
 
158
 
 
159
        public int getAtomNumber(IAtom atom) {
 
160
                logger.debug("Getting atom number: ", atom);
 
161
                return super.getAtomNumber(atom);
 
162
        }
 
163
 
 
164
        public int getBondNumber(IAtom atom1, IAtom atom2) {
 
165
                logger.debug("Getting bond number: atom1=" + atom1, " atom2=" + atom2);
 
166
                return super.getBondNumber(atom1, atom2);
 
167
        }
 
168
 
 
169
        public int getBondNumber(IBond bond) {
 
170
                logger.debug("Getting bond number: ", bond);
 
171
                return super.getBondNumber(bond);
 
172
        }
 
173
 
 
174
        public int getLonePairNumber(ILonePair bond) {
 
175
                logger.debug("Getting lone pair number: ", bond);
 
176
                return super.getLonePairNumber(bond);
 
177
        }
 
178
        
 
179
        public int getSingleElectronNumber(ISingleElectron bond) {
 
180
                logger.debug("Getting single electron number: ", bond);
 
181
                return super.getSingleElectronNumber(bond);
 
182
        }
 
183
        
 
184
        public IElectronContainer getElectronContainer(int number) {
 
185
                logger.debug("Getting electron container at: ", number);
 
186
                return super.getElectronContainer(number);
 
187
        }
 
188
 
 
189
        public IBond getBond(IAtom atom1, IAtom atom2) {
 
190
                logger.debug("Getting bond for atoms: atom1=" + atom1, " atom2=" + atom2);
 
191
                return super.getBond(atom1, atom2);
 
192
        }
 
193
        
 
194
        public int getAtomCount() {
 
195
                logger.debug("Getting atom count");
 
196
                return super.getAtomCount();
 
197
        }
 
198
 
 
199
        public int getBondCount() {
 
200
                logger.debug("Getting bond count");
 
201
                return super.getBondCount();
 
202
        }
 
203
        
 
204
        public int getLonePairCount() {
 
205
                logger.debug("Getting lone pair count");
 
206
                return super.getLonePairCount();
 
207
        }
 
208
 
 
209
        public int getSingleElectronCount() {
 
210
                logger.debug("Getting single electron count");
 
211
                return super.getSingleElectronCount();
 
212
        }
 
213
        
 
214
        public int getElectronContainerCount() {
 
215
                logger.debug("Getting electron container count");
 
216
                return super.getElectronContainerCount();
 
217
        }
 
218
 
 
219
        
 
220
//      public IAtom[] getConnectedAtoms(IAtom atom) {
 
221
//              logger.debug("Getting connected atoms for atom: ", atom);
 
222
//              return super.getConnectedAtoms(atom);
 
223
//      }
 
224
 
 
225
        public List getConnectedAtomsList(IAtom atom) {
 
226
                logger.debug("Getting connecting atoms vector for atom: ", atom);
 
227
                return super.getConnectedAtomsList(atom);
 
228
        }
 
229
 
 
230
//      public IBond[] getConnectedBonds(IAtom atom) {
 
231
//              logger.debug("Getting connected bonds for atom: ", atom);
 
232
//              return super.getConnectedBonds(atom);
 
233
//      }
 
234
 
 
235
        public List getConnectedBondsList(IAtom atom) {
 
236
                logger.debug("Getting connected bonds vector for atom: ", atom);
 
237
                return super.getConnectedBondsList(atom);
 
238
        }
 
239
 
 
240
        public List getConnectedLonePairsList(IAtom atom) {
 
241
                logger.debug("Getting lone pairs at atom: atom=" + atom, " lone pairs=" + super.getConnectedLonePairsCount(atom));
 
242
                return super.getConnectedLonePairsList(atom);
 
243
        }
 
244
        
 
245
        public List getConnectedSingleElectronsList(IAtom atom) {
 
246
                logger.debug("Getting single electrons at atom: atom=" + atom, " single electrons=" + super.getConnectedSingleElectronsCount(atom));
 
247
                return super.getConnectedSingleElectronsList(atom);
 
248
        }
 
249
        
 
250
        public java.util.List getConnectedElectronContainersList(IAtom atom) {
 
251
                logger.debug("Getting connected electron containers for atom: ", atom);
 
252
                return super.getConnectedElectronContainersList(atom);
 
253
        }
 
254
 
 
255
        public int getConnectedAtomsCount(IAtom atom) {
 
256
                logger.debug("Getting connected atoms count for atom: ", atom);
 
257
                return super.getConnectedAtomsCount(atom);
 
258
        }
 
259
        
 
260
        public int getConnectedBondsCount(IAtom atom) {
 
261
                logger.debug("Getting connected bonds count for atom: ", atom);
 
262
                return super.getConnectedBondsCount(atom);
 
263
        }
 
264
        
 
265
        public int getConnectedLonePairsCount(IAtom atom) {
 
266
                logger.debug("Getting connected lone pairs count for atom: ", atom);
 
267
                return super.getConnectedLonePairsCount(atom);
 
268
        }
 
269
        
 
270
        public int getConnectedSingleElectronsCount(IAtom atom) {
 
271
                logger.debug("Getting connected single electrons count for atom: ", atom);
 
272
                return super.getConnectedSingleElectronsCount(atom);
 
273
        }
 
274
        
 
275
        public double getBondOrderSum(IAtom atom) {
 
276
                logger.debug("Getting bond order sum for atom: ", atom);
 
277
                return super.getBondOrderSum(atom);
 
278
        }
 
279
 
 
280
        public double getMaximumBondOrder(IAtom atom) {
 
281
                logger.debug("Getting maximum bond order for atom: ", atom);
 
282
                return super.getMaximumBondOrder(atom);
 
283
        }
 
284
 
 
285
        public double getMinimumBondOrder(IAtom atom) {
 
286
                logger.debug("Getting minimum bond order for atom: ", atom);
 
287
                return super.getMinimumBondOrder(atom);
 
288
        }
 
289
 
 
290
//      public void addElectronContainers(IAtomContainer atomContainer) {
 
291
//              logger.debug("Adding electron containers from atom container: ", atomContainer);
 
292
//              super.addElectronContainers(atomContainer);
 
293
//      }
 
294
 
 
295
        public void add(IAtomContainer atomContainer) {
 
296
                logger.debug("Adding atom container: ", atomContainer);
 
297
                super.add(atomContainer);
 
298
        }
 
299
 
 
300
        public void addAtom(IAtom atom) {
 
301
                logger.debug("Adding atom: ", atom);
 
302
                super.addAtom(atom);
 
303
        }
 
304
 
 
305
        public void addBond(IBond bond) {
 
306
                logger.debug("Adding bond: ", bond);
 
307
                super.addBond(bond);
 
308
        }
 
309
 
 
310
        public void addLonePair(ILonePair ec) {
 
311
                logger.debug("Adding lone pair: ", ec);
 
312
                super.addLonePair(ec);
 
313
        }
 
314
        
 
315
        public void addSingleElectron(ISingleElectron ec) {
 
316
                logger.debug("Adding single electron: ", ec);
 
317
                super.addSingleElectron(ec);
 
318
        }
 
319
        
 
320
        public void addElectronContainer(IElectronContainer electronContainer) {
 
321
                logger.debug("Adding electron container: ", electronContainer);
 
322
                super.addElectronContainer(electronContainer);
 
323
        }
 
324
 
 
325
        public void remove(IAtomContainer atomContainer) {
 
326
                logger.debug("Removing atom container: ", atomContainer);
 
327
                super.remove(atomContainer);
 
328
        }
 
329
 
 
330
        public IElectronContainer removeElectronContainer(int position) {
 
331
                logger.debug("Removing electronContainer: ", position);
 
332
                return super.removeElectronContainer(position);
 
333
        }
 
334
 
 
335
        public void removeElectronContainer(IElectronContainer electronContainer) {
 
336
                logger.debug("Removing electron container: ", electronContainer);
 
337
                super.removeElectronContainer(electronContainer);
 
338
        }
 
339
 
 
340
        public void removeAtom(int position) {
 
341
                logger.debug("Removing atom: ", position);
 
342
                super.removeAtom(position);
 
343
        }
 
344
 
 
345
        public void removeAtom(IAtom atom) {
 
346
                logger.debug("Removing atom: ", atom);
 
347
                super.removeAtom(atom);
 
348
        }
 
349
 
 
350
        public IBond removeBond(int pos) {
 
351
                logger.debug("Removing bond at " + pos);
 
352
                return super.removeBond(pos);
 
353
        }
 
354
        
 
355
        public IBond removeBond(IAtom atom1, IAtom atom2) {
 
356
                logger.debug("Removing bond: atom1=" + atom1 + " atom2=" + atom2);
 
357
                return super.removeBond(atom1, atom2);
 
358
        }
 
359
        
 
360
        public void removeBond(IBond bond) {
 
361
                logger.debug("Removing bond=" + bond);
 
362
                super.removeBond(bond);
 
363
        }
 
364
        
 
365
        public ILonePair removeLonePair(int pos) {
 
366
                logger.debug("Removing bond at " + pos);
 
367
                return super.removeLonePair(pos);
 
368
        }
 
369
        
 
370
        public void removeLonePair(ILonePair ec) {
 
371
                logger.debug("Removing bond=" + ec);
 
372
                super.removeLonePair(ec);
 
373
        }
 
374
        
 
375
        public ISingleElectron removeSingleElectron(int pos) {
 
376
                logger.debug("Removing bond at " + pos);
 
377
                return super.removeSingleElectron(pos);
 
378
        }
 
379
        
 
380
        public void removeSingleElectron(ISingleElectron ec) {
 
381
                logger.debug("Removing bond=" + ec);
 
382
                super.removeSingleElectron(ec);
 
383
        }
 
384
        
 
385
        public void removeAtomAndConnectedElectronContainers(IAtom atom) {
 
386
                logger.debug("Removing atom and connected electron containers: ", atom);
 
387
                super.removeAtomAndConnectedElectronContainers(atom);           
 
388
        }
 
389
        
 
390
        public void removeAllElements() {
 
391
                logger.debug("Removing all elements");
 
392
                super.removeAllElements();
 
393
        }
 
394
 
 
395
        public void removeAllElectronContainers() {
 
396
                logger.debug("Removing all electron containers");
 
397
                super.removeAllElectronContainers();
 
398
        }
 
399
 
 
400
        public void removeAllBonds() {
 
401
                logger.debug("Removing all bonds");
 
402
                super.removeAllBonds();
 
403
        }
 
404
 
 
405
        public void addBond(int atom1, int atom2, double order, int stereo) {
 
406
                logger.debug("Adding bond: atom1=" + atom1 + " atom2=" + atom2, " order=" + order + " stereo=" + stereo);
 
407
                super.addBond(atom1, atom2, order, stereo);
 
408
        }
 
409
 
 
410
        public void addBond(int atom1, int atom2, double order) {
 
411
                logger.debug("Adding bond: atom1=" + atom1 + " atom2=" + atom2, " order=" + order);
 
412
                super.addBond(atom1, atom2, order);
 
413
        }
 
414
 
 
415
        public void addLonePair(int atomID) {
 
416
                logger.debug("Adding lone pair: ", atomID);
 
417
                super.addLonePair(atomID);
 
418
        }
 
419
 
 
420
        public void addSingleElectron(int atomID) {
 
421
                logger.debug("Adding single electron: ", atomID);
 
422
                super.addSingleElectron(atomID);
 
423
        }
 
424
        
 
425
        public boolean contains(IAtom atom) {
 
426
                logger.debug("Contains atom: ", atom);
 
427
                return super.contains(atom);
 
428
        }
 
429
 
 
430
        public boolean contains(IBond bond) {
 
431
                logger.debug("Contains bond: ", bond);
 
432
                return super.contains(bond);
 
433
        }
 
434
        
 
435
        public boolean contains(ILonePair ec) {
 
436
                logger.debug("Contains lone pair: ", ec);
 
437
                return super.contains(ec);
 
438
        }
 
439
        
 
440
        public boolean contains(ISingleElectron ec) {
 
441
                logger.debug("Contains single electron: ", ec);
 
442
                return super.contains(ec);
 
443
        }
 
444
        
 
445
        public boolean contains(IElectronContainer electronContainer) {
 
446
                logger.debug("Contains electron container: ", electronContainer);
 
447
                return super.contains(electronContainer);
 
448
        }
 
449
 
 
450
        public void addListener(IChemObjectListener col) {
 
451
                logger.debug("Adding listener: ", col);
 
452
                super.addListener(col);
 
453
        }
 
454
 
 
455
        public int getListenerCount() {
 
456
                logger.debug("Getting listener count: ", super.getListenerCount());
 
457
                return super.getListenerCount();
 
458
        }
 
459
 
 
460
        public void removeListener(IChemObjectListener col) {
 
461
                logger.debug("Removing listener: ", col);
 
462
                super.removeListener(col);
 
463
        }
 
464
 
 
465
        public void notifyChanged() {
 
466
                logger.debug("Notifying changed");
 
467
                super.notifyChanged();
 
468
        }
 
469
 
 
470
        public void notifyChanged(IChemObjectChangeEvent evt) {
 
471
                logger.debug("Notifying changed event: ", evt);
 
472
                super.notifyChanged(evt);
 
473
        }
 
474
 
 
475
        public void setProperty(Object description, Object property) {
 
476
                logger.debug("Setting property: ", description + "=" + property);
 
477
                super.setProperty(description, property);
 
478
        }
 
479
 
 
480
        public void removeProperty(Object description) {
 
481
                logger.debug("Removing property: ", description);
 
482
                super.removeProperty(description);
 
483
        }
 
484
 
 
485
        public Object getProperty(Object description) {
 
486
                logger.debug("Getting property: ", description + "=" + super.getProperty(description));
 
487
                return super.getProperty(description);
 
488
        }
 
489
 
 
490
        public Hashtable getProperties() {
 
491
                logger.debug("Getting properties");
 
492
                return super.getProperties();
 
493
        }
 
494
 
 
495
        public String getID() {
 
496
                logger.debug("Getting ID: ", super.getID());
 
497
                return super.getID();
 
498
        }
 
499
 
 
500
        public void setID(String identifier) {
 
501
                logger.debug("Setting ID: ", identifier);
 
502
                super.setID(identifier);
 
503
        }
 
504
 
 
505
        public void setFlag(int flag_type, boolean flag_value) {
 
506
                logger.debug("Setting flag: ", flag_type + "=" + flag_value);
 
507
                super.setFlag(flag_type, flag_value);
 
508
        }
 
509
 
 
510
        public boolean getFlag(int flag_type) {
 
511
                logger.debug("Setting flag: ", flag_type + "=" + super.getFlag(flag_type));
 
512
                return super.getFlag(flag_type);
 
513
        }
 
514
 
 
515
        public void setProperties(Hashtable properties) {
 
516
                logger.debug("Setting properties: ", properties);
 
517
                super.setProperties(properties);
 
518
        }
 
519
 
 
520
        public void setFlags(boolean[] flagsNew) {
 
521
                logger.debug("Setting flags:", flagsNew.length);
 
522
                super.setFlags(flagsNew);
 
523
        }
 
524
 
 
525
        public boolean[] getFlags() {
 
526
                logger.debug("Getting flags:", super.getFlags().length);
 
527
                return super.getFlags();
 
528
        }
 
529
 
 
530
        public Object clone() throws CloneNotSupportedException {
 
531
        Object clone = null;
 
532
        try {
 
533
                clone = super.clone();
 
534
        } catch (Exception exception) {
 
535
                logger.error("Could not clone DebugAtom: " + exception.getMessage(), exception);
 
536
                logger.debug(exception);
 
537
        }
 
538
        return clone;
 
539
        }
 
540
 
 
541
        public IChemObjectBuilder getBuilder() {
 
542
                return DebugChemObjectBuilder.getInstance();
 
543
        }
 
544
 
 
545
}