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

DefaultChemObjectBuilder.java

/* $RCSfile$
 * $Author$
 * $Date$
 * $Revision$
 *
 * 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 org.openscience.cdk.formula.AdductFormula;
import org.openscience.cdk.formula.MolecularFormula;
import org.openscience.cdk.formula.MolecularFormulaSet;
import org.openscience.cdk.interfaces.*;
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;

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

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

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

      public static DefaultChemObjectBuilder getInstance() {
            if (instance == null) {
                  instance = new DefaultChemObjectBuilder();
            }
            return instance;
      }
      
00058       public IAminoAcid newAminoAcid() {
            return new AminoAcid();
      }
      
00062       public IAtom newAtom() {
            return new Atom();
      }
      
00066     public IAtom newAtom(String elementSymbol) {
      return new Atom(elementSymbol);
    }
    
00070     public IAtom newAtom(String elementSymbol, javax.vecmath.Point2d point2d) {
      return new Atom(elementSymbol, point2d);
    }

00074     public IAtom newAtom(String elementSymbol, javax.vecmath.Point3d point3d) {
      return new Atom(elementSymbol, point3d);
    }
            
00078       public IAtomContainer newAtomContainer() {
            return new AtomContainer();
      }
    
00082       public IAtomContainer newAtomContainer(int atomCount, int bondCount, int lonePairCount, int singleElectronCount) {
            return new AtomContainer(atomCount, bondCount, lonePairCount, singleElectronCount);
      }
    
00086       public IAtomContainer newAtomContainer(IAtomContainer container) {
            return new AtomContainer(container);
      }
      
00090     public IAtomParity newAtomParity(IAtom centralAtom, IAtom first, IAtom second, 
            IAtom third, IAtom fourth, int parity) {
      return new AtomParity(centralAtom, first, second, third, fourth, parity);
    }

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

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

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

00107       public IBond newBond() {
            return new Bond();
      }
      
00111       public IBond newBond(IAtom atom1, IAtom atom2) {
            return new Bond(atom1, atom2);
      }
      
      public IBond newBond(IAtom atom1, IAtom atom2, IBond.Order order) {
            return new Bond(atom1, atom2, order);
      }
      
      public IBond newBond(IAtom atom1, IAtom atom2, IBond.Order order, int stereo) {
            return new Bond(atom1, atom2, order, stereo);
      }

00123     public IBond newBond(IAtom[] atoms) {
        return new Bond(atoms);
    }

    public IBond newBond(IAtom[] atoms, IBond.Order order) {
        return new Bond(atoms, order);
    }

00131     public IChemFile newChemFile() {
            return new ChemFile();
      }

00135       public IChemModel newChemModel() {
            return new ChemModel();
      }
      
00139       public IChemObject newChemObject() {
            return new ChemObject();
      }
      
00143       public IChemSequence newChemSequence() {
            return new ChemSequence();   
      }
      
00147     public ICrystal newCrystal() {
      return new Crystal();
    }
    
00151     public ICrystal newCrystal(IAtomContainer container) {
      return new Crystal(container);
    }
    
00155     public IElectronContainer newElectronContainer() {
      return new ElectronContainer();
    }
    
00159     public IElement newElement() {
      return new Element();
    }

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

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

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

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

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

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

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

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

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

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

00213       public IMonomer newMonomer () {
            return new Monomer();
      }
      
00217       public IPolymer newPolymer() {
            return new Polymer();
      }
      
00221       public IPDBAtom newPDBAtom(IElement element){
            return new PDBAtom(element);
      }
      
00225       public IPDBAtom newPDBAtom(String symbol){
            return new PDBAtom(symbol);
      }
      
00229       public IPDBAtom newPDBAtom(String symbol, Point3d coordinate){
            return new PDBAtom(symbol, coordinate);
      }

00233       public IPDBPolymer newPDBPolymer() {
            return new PDBPolymer();
      }
      
00237       public IPDBStructure newPDBStructure() {
            return new PDBStructure();
      }
      
00241       public IPDBMonomer newPDBMonomer() {
            return new PDBMonomer();
      }

00245     public IReaction newReaction() {
      return new Reaction();  
    }
      
00249       public IRing newRing() {
            return new Ring();
      }
      
00253       public IRing newRing(IAtomContainer container) {
            return new Ring(container);
      }
      
00257       public IRing newRing(int ringSize, String elementSymbol) {
            return new Ring(ringSize, elementSymbol);
      }
      
00261       public IRing newRing(int ringSize) {
            return new Ring(ringSize);
      }

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

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

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

00277       public IReactionSet newReactionSet() {
            return new ReactionSet();
      }

00281       public IReactionScheme newReactionScheme() {
            return new ReactionScheme();
      }
      
00285     public ISingleElectron newSingleElectron() {
      return new SingleElectron();
    }
    
00289     public ISingleElectron newSingleElectron(IAtom atom) {
      return new SingleElectron(atom);   
    }

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

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

00301       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);
      }

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

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

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

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

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

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

00341       public IFragmentAtom newFragmentAtom() {
            return new FragmentAtom();
      }

      public IAdductFormula newAdductFormula() {
          return new AdductFormula();
    }

      public IMolecularFormula newMolecularFormula() {
          return new MolecularFormula();
    }

      public IMolecularFormulaSet newMolecularFormulaSet() {
          return new MolecularFormulaSet();
    }

      public IAdductFormula newAdductFormula(IMolecularFormula formula) {
          return new AdductFormula(formula);
    }

      public IMolecularFormulaSet newMolecularFormulaSet(IMolecularFormula formula) {
          return new MolecularFormulaSet(formula);
    }
}



Generated by  Doxygen 1.6.0   Back to index