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

« back to all changes in this revision

Viewing changes to src/org/openscience/cdk/debug/DebugChemObjectBuilder.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 javax.vecmath.Point2d;
 
24
import javax.vecmath.Point3d;
 
25
 
 
26
import org.openscience.cdk.interfaces.IAminoAcid;
 
27
import org.openscience.cdk.interfaces.IAtom;
 
28
import org.openscience.cdk.interfaces.IAtomContainer;
 
29
import org.openscience.cdk.interfaces.IAtomContainerSet;
 
30
import org.openscience.cdk.interfaces.IAtomParity;
 
31
import org.openscience.cdk.interfaces.IAtomType;
 
32
import org.openscience.cdk.interfaces.IBioPolymer;
 
33
import org.openscience.cdk.interfaces.IBond;
 
34
import org.openscience.cdk.interfaces.IChemFile;
 
35
import org.openscience.cdk.interfaces.IChemModel;
 
36
import org.openscience.cdk.interfaces.IChemObject;
 
37
import org.openscience.cdk.interfaces.IChemObjectBuilder;
 
38
import org.openscience.cdk.interfaces.IChemSequence;
 
39
import org.openscience.cdk.interfaces.ICrystal;
 
40
import org.openscience.cdk.interfaces.IElectronContainer;
 
41
import org.openscience.cdk.interfaces.IElement;
 
42
import org.openscience.cdk.interfaces.IIsotope;
 
43
import org.openscience.cdk.interfaces.ILonePair;
 
44
import org.openscience.cdk.interfaces.IMapping;
 
45
import org.openscience.cdk.interfaces.IMolecule;
 
46
import org.openscience.cdk.interfaces.IMoleculeSet;
 
47
import org.openscience.cdk.interfaces.IMonomer;
 
48
import org.openscience.cdk.interfaces.IPDBAtom;
 
49
import org.openscience.cdk.interfaces.IPDBMonomer;
 
50
import org.openscience.cdk.interfaces.IPDBPolymer;
 
51
import org.openscience.cdk.interfaces.IPDBStructure;
 
52
import org.openscience.cdk.interfaces.IPolymer;
 
53
import org.openscience.cdk.interfaces.IPseudoAtom;
 
54
import org.openscience.cdk.interfaces.IReaction;
 
55
import org.openscience.cdk.interfaces.IReactionSet;
 
56
import org.openscience.cdk.interfaces.IRing;
 
57
import org.openscience.cdk.interfaces.IRingSet;
 
58
import org.openscience.cdk.interfaces.ISingleElectron;
 
59
import org.openscience.cdk.interfaces.IStrand;
 
60
 
 
61
/**
 
62
 * A helper class to instantiate a IChemObject for the debug implementation.
 
63
 *
 
64
 * @author        egonw
 
65
 * @cdk.module    datadebug
 
66
 */
 
67
public class DebugChemObjectBuilder implements IChemObjectBuilder {
 
68
 
 
69
        private static DebugChemObjectBuilder instance = null;
 
70
        
 
71
        private DebugChemObjectBuilder() {}
 
72
 
 
73
        public static DebugChemObjectBuilder getInstance() {
 
74
                if (instance == null) {
 
75
                        instance = new DebugChemObjectBuilder();
 
76
                }
 
77
                return instance;
 
78
        }
 
79
        
 
80
        public IAminoAcid newAminoAcid() {
 
81
                return new DebugAminoAcid();
 
82
        }
 
83
        
 
84
        public IAtom newAtom() {
 
85
                return new DebugAtom();
 
86
        }
 
87
        
 
88
    public IAtom newAtom(String elementSymbol) {
 
89
        return new DebugAtom(elementSymbol);
 
90
    }
 
91
    
 
92
    public IAtom newAtom(String elementSymbol, javax.vecmath.Point2d point2d) {
 
93
        return new DebugAtom(elementSymbol, point2d);
 
94
    }
 
95
 
 
96
    public IAtom newAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
 
97
        return new DebugAtom(elementSymbol, point3d);
 
98
    }
 
99
                
 
100
        public IAtomContainer newAtomContainer() {
 
101
                return new DebugAtomContainer();
 
102
        }
 
103
    
 
104
        public IAtomContainer newAtomContainer(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
 
105
                return new DebugAtomContainer(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
 
106
        }
 
107
    
 
108
        public IAtomContainer newAtomContainer(IAtomContainer container) {
 
109
                return new DebugAtomContainer(container);
 
110
        }
 
111
        
 
112
    public IAtomParity newAtomParity(
 
113
                IAtom centralAtom, 
 
114
                IAtom first, 
 
115
                IAtom second, 
 
116
                IAtom third, 
 
117
                IAtom fourth,
 
118
            int parity) {
 
119
        return new DebugAtomParity(centralAtom, first, second, third, fourth, parity);
 
120
    }
 
121
 
 
122
        public IAtomType newAtomType(String elementSymbol) {
 
123
                return new DebugAtomType(elementSymbol);
 
124
        }
 
125
 
 
126
        public IAtomType newAtomType(String identifier, String elementSymbol) {
 
127
                return new DebugAtomType(identifier, elementSymbol);
 
128
        }
 
129
 
 
130
        public IBioPolymer newBioPolymer(){
 
131
                return new DebugBioPolymer();
 
132
        }
 
133
        
 
134
        public IPDBAtom newPDBAtom(IElement element) {
 
135
        return new DebugPDBAtom(element);
 
136
    }
 
137
        
 
138
        public IPDBAtom newPDBAtom(String elementSymbol) {
 
139
        return new DebugPDBAtom(elementSymbol);
 
140
    }
 
141
    
 
142
    public IPDBAtom newPDBAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
 
143
        return new DebugPDBAtom(elementSymbol, point3d);
 
144
    }
 
145
    
 
146
    public IPDBStructure newPDBStructure() {
 
147
        return new DebugPDBStructure();
 
148
    }
 
149
    
 
150
        public IPDBPolymer newPDBPolymer(){
 
151
                return new DebugPDBPolymer();
 
152
        }
 
153
        
 
154
        public IPDBMonomer newPDBMonomer(){
 
155
                return new DebugPDBMonomer();
 
156
        }
 
157
        
 
158
        public IPDBStructure newStructure(){
 
159
                return new DebugPDBStructure();
 
160
        }
 
161
 
 
162
        public IBond newBond() {
 
163
                return new DebugBond();
 
164
        }
 
165
        
 
166
        public IBond newBond(IAtom atom1, IAtom atom2) {
 
167
                return new DebugBond(atom1, atom2);
 
168
        }
 
169
        
 
170
        public IBond newBond(IAtom atom1, IAtom atom2, double order) {
 
171
                return new DebugBond(atom1, atom2, order);
 
172
        }
 
173
        
 
174
        public IBond newBond(IAtom atom1, IAtom atom2, double order, int stereo) {
 
175
                return new DebugBond(atom1, atom2, order, stereo);
 
176
        }
 
177
        
 
178
        public IChemFile newChemFile() {
 
179
                return new DebugChemFile();
 
180
        }
 
181
 
 
182
        public IChemModel newChemModel() {
 
183
                return new DebugChemModel();
 
184
        }
 
185
        
 
186
        public IChemObject newChemObject() {
 
187
                return new DebugChemObject();
 
188
        }
 
189
        
 
190
        public IChemSequence newChemSequence() {
 
191
                return new DebugChemSequence();   
 
192
        }
 
193
        
 
194
    public ICrystal newCrystal() {
 
195
        return new DebugCrystal();
 
196
    }
 
197
    
 
198
    public ICrystal newCrystal(IAtomContainer container) {
 
199
        return new DebugCrystal(container);
 
200
    }
 
201
    
 
202
    public IElectronContainer newElectronContainer() {
 
203
        return new DebugElectronContainer();
 
204
    }
 
205
    
 
206
    public IElement newElement() {
 
207
        return new DebugElement();
 
208
    }
 
209
 
 
210
    public IElement newElement(String symbol) {
 
211
        return new DebugElement(symbol);
 
212
    }
 
213
 
 
214
    public IElement newElement(String symbol, int atomicNumber) {
 
215
        return new DebugElement(symbol, atomicNumber);
 
216
    }
 
217
 
 
218
        public IIsotope newIsotope(String elementSymbol) {
 
219
                return new DebugIsotope(elementSymbol);
 
220
        }
 
221
        
 
222
        public IIsotope newIsotope(int atomicNumber, String elementSymbol, 
 
223
                        int massNumber, double exactMass, double abundance) {
 
224
                return new DebugIsotope(atomicNumber, elementSymbol, massNumber, exactMass, abundance);
 
225
        }
 
226
 
 
227
        public IIsotope newIsotope(int atomicNumber, String elementSymbol, 
 
228
                        double exactMass, double abundance) {
 
229
                return new DebugIsotope(atomicNumber, elementSymbol, exactMass, abundance);
 
230
        }
 
231
 
 
232
        public IIsotope newIsotope(String elementSymbol, int massNumber) {
 
233
                return new DebugIsotope(elementSymbol, massNumber);
 
234
        }
 
235
 
 
236
    public ILonePair newLonePair() {
 
237
        return new DebugLonePair();
 
238
    }
 
239
 
 
240
    public ILonePair newLonePair(IAtom atom) {
 
241
        return new DebugLonePair(atom);
 
242
    }
 
243
 
 
244
    public IMapping newMapping(IChemObject objectOne, IChemObject objectTwo) {
 
245
                return new DebugMapping(objectOne, objectTwo);
 
246
        }
 
247
    
 
248
        public IMolecule newMolecule() {
 
249
                return new DebugMolecule();
 
250
        }
 
251
 
 
252
        public IMolecule newMolecule(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
 
253
                return new DebugMolecule(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
 
254
        }
 
255
 
 
256
        public IMolecule newMolecule(IAtomContainer container) {
 
257
                return new DebugMolecule(container);
 
258
        }
 
259
 
 
260
        public IMonomer newMonomer () {
 
261
                return new DebugMonomer();
 
262
        }
 
263
        
 
264
        public IPolymer newPolymer() {
 
265
                return new DebugPolymer();
 
266
        }
 
267
 
 
268
    public IReaction newReaction() {
 
269
        return new DebugReaction();     
 
270
    }
 
271
        
 
272
        public IRing newRing() {
 
273
                return new DebugRing();
 
274
        }
 
275
        
 
276
        public IRing newRing(IAtomContainer container) {
 
277
                return new DebugRing(container);
 
278
        }
 
279
        
 
280
        public IRing newRing(int ringSize, String elementSymbol) {
 
281
                return new DebugRing(ringSize, elementSymbol);
 
282
        }
 
283
        
 
284
        public IRing newRing(int ringSize) {
 
285
                return new DebugRing(ringSize);
 
286
        }
 
287
 
 
288
        public IRingSet newRingSet() {
 
289
                return new DebugRingSet();
 
290
        }
 
291
 
 
292
        public IAtomContainerSet newAtomContainerSet() {
 
293
                return new DebugAtomContainerSet();
 
294
        }
 
295
 
 
296
        public IMoleculeSet newMoleculeSet() {
 
297
                return new DebugMoleculeSet();
 
298
        }
 
299
 
 
300
        public IReactionSet newReactionSet() {
 
301
                return new DebugReactionSet();
 
302
        }
 
303
        
 
304
    public ISingleElectron newSingleElectron() {
 
305
        return new DebugSingleElectron();
 
306
    }
 
307
    
 
308
    public ISingleElectron newSingleElectron(IAtom atom) {
 
309
        return new DebugSingleElectron(atom);   
 
310
    }
 
311
 
 
312
        public IStrand newStrand() {
 
313
                return new DebugStrand();
 
314
        }
 
315
 
 
316
        public IPseudoAtom newPseudoAtom() {
 
317
                return new DebugPseudoAtom();
 
318
        }
 
319
 
 
320
        public IPseudoAtom newPseudoAtom(String label) {
 
321
                return new DebugPseudoAtom(label);
 
322
        }
 
323
 
 
324
        public IPseudoAtom newPseudoAtom(IAtom atom) {
 
325
                return new DebugPseudoAtom(atom);
 
326
        }
 
327
 
 
328
        public IPseudoAtom newPseudoAtom(String label, Point3d point3d) {
 
329
                return new DebugPseudoAtom(label, point3d);
 
330
        }
 
331
 
 
332
        public IPseudoAtom newPseudoAtom(String label, Point2d point2d) {
 
333
                return new DebugPseudoAtom(label, point2d);
 
334
        }
 
335
 
 
336
        public IAtom newAtom(IElement element) {
 
337
                return new DebugAtom(element);
 
338
        }
 
339
 
 
340
        public IAtomType newAtomType(IElement element) {
 
341
                return new DebugAtomType(element);
 
342
        }
 
343
 
 
344
        public IChemObject newChemObject(IChemObject object) {
 
345
                return new DebugChemObject(object);
 
346
        }
 
347
 
 
348
        public IElement newElement(IElement element) {
 
349
                return new DebugElement(element);
 
350
        }
 
351
 
 
352
        public IIsotope newIsotope(IElement element) {
 
353
                return new DebugIsotope(element);
 
354
        }
 
355
 
 
356
        public IPseudoAtom newPseudoAtom(IElement element) {
 
357
                return new DebugPseudoAtom(element);
 
358
        }
 
359
}
 
360
 
 
361