Logo Search packages:      
Sourcecode: cdk version File versions  Download package

DefaultChemObjectBuilder.java

/* $RCSfile$
 * $Author: egonw $
 * $Date: 2007-01-04 18:46:10 +0100 (Thu, 04 Jan 2007) $
 * $Revision: 7636 $
 *
 * Copyright (C) 2005-2007  Egon Willighagen <egonw@users.sf.net>
 *
 * Contact: cdk-devel@lists.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package org.openscience.cdk;

import javax.vecmath.Point2d;
import javax.vecmath.Point3d;

import org.openscience.cdk.interfaces.IAminoAcid;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IAtomParity;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBioPolymer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemFile;
import org.openscience.cdk.interfaces.IChemModel;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IChemSequence;
import org.openscience.cdk.interfaces.ICrystal;
import org.openscience.cdk.interfaces.IElectronContainer;
import org.openscience.cdk.interfaces.IElement;
import org.openscience.cdk.interfaces.IIsotope;
import org.openscience.cdk.interfaces.ILonePair;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IMonomer;
import org.openscience.cdk.interfaces.IPDBAtom;
import org.openscience.cdk.interfaces.IPDBMonomer;
import org.openscience.cdk.interfaces.IPDBPolymer;
import org.openscience.cdk.interfaces.IPDBStructure;
import org.openscience.cdk.interfaces.IPolymer;
import org.openscience.cdk.interfaces.IPseudoAtom;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.interfaces.IRing;
import org.openscience.cdk.interfaces.IRingSet;
import org.openscience.cdk.interfaces.ISingleElectron;
import org.openscience.cdk.interfaces.IStrand;
import org.openscience.cdk.protein.data.PDBAtom;
import org.openscience.cdk.protein.data.PDBMonomer;
import org.openscience.cdk.protein.data.PDBPolymer;
import org.openscience.cdk.protein.data.PDBStructure;

/**
 * A helper class to instantiate a IChemObject for a specific implementation.
 *
 * @author        egonw
 * @cdk.module    data
 */
00074 public class DefaultChemObjectBuilder implements IChemObjectBuilder {

      private static DefaultChemObjectBuilder instance = null;
      
      private DefaultChemObjectBuilder() {}

      public static DefaultChemObjectBuilder getInstance() {
            if (instance == null) {
                  instance = new DefaultChemObjectBuilder();
            }
            return instance;
      }
      
00087       public IAminoAcid newAminoAcid() {
            return new AminoAcid();
      }
      
00091       public IAtom newAtom() {
            return new Atom();
      }
      
00095     public IAtom newAtom(String elementSymbol) {
      return new Atom(elementSymbol);
    }
    
00099     public IAtom newAtom(String elementSymbol, javax.vecmath.Point2d point2d) {
      return new Atom(elementSymbol, point2d);
    }

00103     public IAtom newAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
      return new Atom(elementSymbol, point3d);
    }
            
00107       public IAtomContainer newAtomContainer() {
            return new AtomContainer();
      }
    
00111       public IAtomContainer newAtomContainer(int atomCount, int bondCount, int lonePairCount, int singleElectronCount) {
            return new AtomContainer(atomCount, bondCount, lonePairCount, singleElectronCount);
      }
    
00115       public IAtomContainer newAtomContainer(IAtomContainer container) {
            return new AtomContainer(container);
      }
      
00119     public IAtomParity newAtomParity(IAtom centralAtom, IAtom first, IAtom second, 
            IAtom third, IAtom fourth, int parity) {
      return new AtomParity(centralAtom, first, second, third, fourth, parity);
    }

00124       public IAtomType newAtomType(String elementSymbol) {
            return new AtomType(elementSymbol);
      }

00128       public IAtomType newAtomType(String identifier, String elementSymbol) {
            return new AtomType(identifier, elementSymbol);
      }

00132       public IBioPolymer newBioPolymer(){
            return new BioPolymer();
      }

00136       public IBond newBond() {
            return new Bond();
      }
      
00140       public IBond newBond(IAtom atom1, IAtom atom2) {
            return new Bond(atom1, atom2);
      }
      
00144       public IBond newBond(IAtom atom1, IAtom atom2, double order) {
            return new Bond(atom1, atom2, order);
      }
      
00148       public IBond newBond(IAtom atom1, IAtom atom2, double order, int stereo) {
            return new Bond(atom1, atom2, order, stereo);
      }
      
00152       public IChemFile newChemFile() {
            return new ChemFile();
      }

00156       public IChemModel newChemModel() {
            return new ChemModel();
      }
      
00160       public IChemObject newChemObject() {
            return new ChemObject();
      }
      
00164       public IChemSequence newChemSequence() {
            return new ChemSequence();   
      }
      
00168     public ICrystal newCrystal() {
      return new Crystal();
    }
    
00172     public ICrystal newCrystal(IAtomContainer container) {
      return new Crystal(container);
    }
    
00176     public IElectronContainer newElectronContainer() {
      return new ElectronContainer();
    }
    
00180     public IElement newElement() {
      return new Element();
    }

00184     public IElement newElement(String symbol) {
      return new Element(symbol);
    }

00188     public IElement newElement(String symbol, int atomicNumber) {
      return new Element(symbol, atomicNumber);
    }

00192       public IIsotope newIsotope(String elementSymbol) {
            return new Isotope(elementSymbol);
      }
      
00196       public IIsotope newIsotope(int atomicNumber, String elementSymbol, 
                  int massNumber, double exactMass, double abundance) {
            return new Isotope(atomicNumber, elementSymbol, massNumber, exactMass, abundance);
      }

00201       public IIsotope newIsotope(int atomicNumber, String elementSymbol, 
                  double exactMass, double abundance) {
            return new Isotope(atomicNumber, elementSymbol, exactMass, abundance);
      }

00206       public IIsotope newIsotope(String elementSymbol, int massNumber) {
            return new Isotope(elementSymbol, massNumber);
      }

00210     public ILonePair newLonePair() {
      return new LonePair();
    }

00214     public ILonePair newLonePair(IAtom atom) {
      return new LonePair(atom);
    }

00218     public IMapping newMapping(IChemObject objectOne, IChemObject objectTwo) {
            return new Mapping(objectOne, objectTwo);
      }
    
00222       public IMolecule newMolecule() {
            return new Molecule();
      }

00226       public IMolecule newMolecule(int atomCount, int electronContainerCount, int lonePairCount, int singleElectronCount) {
            return new Molecule(atomCount, electronContainerCount, lonePairCount, singleElectronCount);
      }

00230       public IMolecule newMolecule(IAtomContainer container) {
            return new Molecule(container);
      }

00234       public IMonomer newMonomer () {
            return new Monomer();
      }
      
00238       public IPolymer newPolymer() {
            return new Polymer();
      }
      
00242       public IPDBAtom newPDBAtom(IElement element){
            return new PDBAtom(element);
      }
      
00246       public IPDBAtom newPDBAtom(String symbol){
            return new PDBAtom(symbol);
      }
      
00250       public IPDBAtom newPDBAtom(String symbol, Point3d coordinate){
            return new PDBAtom(symbol, coordinate);
      }

00254       public IPDBPolymer newPDBPolymer() {
            return new PDBPolymer();
      }
      
00258       public IPDBStructure newPDBStructure() {
            return new PDBStructure();
      }
      
00262       public IPDBMonomer newPDBMonomer() {
            return new PDBMonomer();
      }

00266     public IReaction newReaction() {
      return new Reaction();  
    }
      
00270       public IRing newRing() {
            return new Ring();
      }
      
00274       public IRing newRing(IAtomContainer container) {
            return new Ring(container);
      }
      
00278       public IRing newRing(int ringSize, String elementSymbol) {
            return new Ring(ringSize, elementSymbol);
      }
      
00282       public IRing newRing(int ringSize) {
            return new Ring(ringSize);
      }

00286       public IRingSet newRingSet() {
            return new RingSet();
      }

00290       public IAtomContainerSet newAtomContainerSet() {
            return new AtomContainerSet();
      }

00294       public IMoleculeSet newMoleculeSet() {
            return new MoleculeSet();
      }

00298       public IReactionSet newReactionSet() {
            return new ReactionSet();
      }
      
00302     public ISingleElectron newSingleElectron() {
      return new SingleElectron();
    }
    
00306     public ISingleElectron newSingleElectron(IAtom atom) {
      return new SingleElectron(atom);   
    }

00310       public IStrand newStrand() {
            return new Strand();
      }

00314       public IPseudoAtom newPseudoAtom() {
            return new PseudoAtom();
      }

00318       public IPseudoAtom newPseudoAtom(String label) {
            return new PseudoAtom(label);
      }

      public IPseudoAtom newPseudoAtom(IAtom atom) {
            return new PseudoAtom(atom);
      }

      public IPseudoAtom newPseudoAtom(String label, Point3d point3d) {
            return new PseudoAtom(label, point3d);
      }

      public IPseudoAtom newPseudoAtom(String label, Point2d point2d) {
            return new PseudoAtom(label, point2d);
      }

00334       public IAtom newAtom(IElement element) {
            return new Atom(element);
      }

00338       public IAtomType newAtomType(IElement element) {
            return new AtomType(element);
      }

00342       public IChemObject newChemObject(IChemObject object) {
            return new ChemObject(object);
      }

00346       public IElement newElement(IElement element) {
            return new Element(element);
      }

00350       public IIsotope newIsotope(IElement element) {
            return new Isotope(element);
      }

00354       public IPseudoAtom newPseudoAtom(IElement element) {
            return new PseudoAtom(element);
      }
}



Generated by  Doxygen 1.6.0   Back to index