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 javax.vecmath.Point2d;
24
import javax.vecmath.Point3d;
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;
62
* A helper class to instantiate a IChemObject for the debug implementation.
65
* @cdk.module datadebug
67
public class DebugChemObjectBuilder implements IChemObjectBuilder {
69
private static DebugChemObjectBuilder instance = null;
71
private DebugChemObjectBuilder() {}
73
public static DebugChemObjectBuilder getInstance() {
74
if (instance == null) {
75
instance = new DebugChemObjectBuilder();
80
public IAminoAcid newAminoAcid() {
81
return new DebugAminoAcid();
84
public IAtom newAtom() {
85
return new DebugAtom();
88
public IAtom newAtom(String elementSymbol) {
89
return new DebugAtom(elementSymbol);
92
public IAtom newAtom(String elementSymbol, javax.vecmath.Point2d point2d) {
93
return new DebugAtom(elementSymbol, point2d);
96
public IAtom newAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
97
return new DebugAtom(elementSymbol, point3d);
100
public IAtomContainer newAtomContainer() {
101
return new DebugAtomContainer();
104
public IAtomContainer newAtomContainer(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
105
return new DebugAtomContainer(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
108
public IAtomContainer newAtomContainer(IAtomContainer container) {
109
return new DebugAtomContainer(container);
112
public IAtomParity newAtomParity(
119
return new DebugAtomParity(centralAtom, first, second, third, fourth, parity);
122
public IAtomType newAtomType(String elementSymbol) {
123
return new DebugAtomType(elementSymbol);
126
public IAtomType newAtomType(String identifier, String elementSymbol) {
127
return new DebugAtomType(identifier, elementSymbol);
130
public IBioPolymer newBioPolymer(){
131
return new DebugBioPolymer();
134
public IPDBAtom newPDBAtom(IElement element) {
135
return new DebugPDBAtom(element);
138
public IPDBAtom newPDBAtom(String elementSymbol) {
139
return new DebugPDBAtom(elementSymbol);
142
public IPDBAtom newPDBAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
143
return new DebugPDBAtom(elementSymbol, point3d);
146
public IPDBStructure newPDBStructure() {
147
return new DebugPDBStructure();
150
public IPDBPolymer newPDBPolymer(){
151
return new DebugPDBPolymer();
154
public IPDBMonomer newPDBMonomer(){
155
return new DebugPDBMonomer();
158
public IPDBStructure newStructure(){
159
return new DebugPDBStructure();
162
public IBond newBond() {
163
return new DebugBond();
166
public IBond newBond(IAtom atom1, IAtom atom2) {
167
return new DebugBond(atom1, atom2);
170
public IBond newBond(IAtom atom1, IAtom atom2, double order) {
171
return new DebugBond(atom1, atom2, order);
174
public IBond newBond(IAtom atom1, IAtom atom2, double order, int stereo) {
175
return new DebugBond(atom1, atom2, order, stereo);
178
public IChemFile newChemFile() {
179
return new DebugChemFile();
182
public IChemModel newChemModel() {
183
return new DebugChemModel();
186
public IChemObject newChemObject() {
187
return new DebugChemObject();
190
public IChemSequence newChemSequence() {
191
return new DebugChemSequence();
194
public ICrystal newCrystal() {
195
return new DebugCrystal();
198
public ICrystal newCrystal(IAtomContainer container) {
199
return new DebugCrystal(container);
202
public IElectronContainer newElectronContainer() {
203
return new DebugElectronContainer();
206
public IElement newElement() {
207
return new DebugElement();
210
public IElement newElement(String symbol) {
211
return new DebugElement(symbol);
214
public IElement newElement(String symbol, int atomicNumber) {
215
return new DebugElement(symbol, atomicNumber);
218
public IIsotope newIsotope(String elementSymbol) {
219
return new DebugIsotope(elementSymbol);
222
public IIsotope newIsotope(int atomicNumber, String elementSymbol,
223
int massNumber, double exactMass, double abundance) {
224
return new DebugIsotope(atomicNumber, elementSymbol, massNumber, exactMass, abundance);
227
public IIsotope newIsotope(int atomicNumber, String elementSymbol,
228
double exactMass, double abundance) {
229
return new DebugIsotope(atomicNumber, elementSymbol, exactMass, abundance);
232
public IIsotope newIsotope(String elementSymbol, int massNumber) {
233
return new DebugIsotope(elementSymbol, massNumber);
236
public ILonePair newLonePair() {
237
return new DebugLonePair();
240
public ILonePair newLonePair(IAtom atom) {
241
return new DebugLonePair(atom);
244
public IMapping newMapping(IChemObject objectOne, IChemObject objectTwo) {
245
return new DebugMapping(objectOne, objectTwo);
248
public IMolecule newMolecule() {
249
return new DebugMolecule();
252
public IMolecule newMolecule(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
253
return new DebugMolecule(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
256
public IMolecule newMolecule(IAtomContainer container) {
257
return new DebugMolecule(container);
260
public IMonomer newMonomer () {
261
return new DebugMonomer();
264
public IPolymer newPolymer() {
265
return new DebugPolymer();
268
public IReaction newReaction() {
269
return new DebugReaction();
272
public IRing newRing() {
273
return new DebugRing();
276
public IRing newRing(IAtomContainer container) {
277
return new DebugRing(container);
280
public IRing newRing(int ringSize, String elementSymbol) {
281
return new DebugRing(ringSize, elementSymbol);
284
public IRing newRing(int ringSize) {
285
return new DebugRing(ringSize);
288
public IRingSet newRingSet() {
289
return new DebugRingSet();
292
public IAtomContainerSet newAtomContainerSet() {
293
return new DebugAtomContainerSet();
296
public IMoleculeSet newMoleculeSet() {
297
return new DebugMoleculeSet();
300
public IReactionSet newReactionSet() {
301
return new DebugReactionSet();
304
public ISingleElectron newSingleElectron() {
305
return new DebugSingleElectron();
308
public ISingleElectron newSingleElectron(IAtom atom) {
309
return new DebugSingleElectron(atom);
312
public IStrand newStrand() {
313
return new DebugStrand();
316
public IPseudoAtom newPseudoAtom() {
317
return new DebugPseudoAtom();
320
public IPseudoAtom newPseudoAtom(String label) {
321
return new DebugPseudoAtom(label);
324
public IPseudoAtom newPseudoAtom(IAtom atom) {
325
return new DebugPseudoAtom(atom);
328
public IPseudoAtom newPseudoAtom(String label, Point3d point3d) {
329
return new DebugPseudoAtom(label, point3d);
332
public IPseudoAtom newPseudoAtom(String label, Point2d point2d) {
333
return new DebugPseudoAtom(label, point2d);
336
public IAtom newAtom(IElement element) {
337
return new DebugAtom(element);
340
public IAtomType newAtomType(IElement element) {
341
return new DebugAtomType(element);
344
public IChemObject newChemObject(IChemObject object) {
345
return new DebugChemObject(object);
348
public IElement newElement(IElement element) {
349
return new DebugElement(element);
352
public IIsotope newIsotope(IElement element) {
353
return new DebugIsotope(element);
356
public IPseudoAtom newPseudoAtom(IElement element) {
357
return new DebugPseudoAtom(element);