Skip to content

Commit

Permalink
Removed IMolecule
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Dec 15, 2011
1 parent 611aaca commit 2fc6b61
Show file tree
Hide file tree
Showing 184 changed files with 1,460 additions and 1,834 deletions.
16 changes: 0 additions & 16 deletions src/main/org/openscience/cdk/DefaultChemObjectBuilder.java
Expand Up @@ -51,7 +51,6 @@
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IMolecularFormula;
import org.openscience.cdk.interfaces.IMolecularFormulaSet;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMonomer;
import org.openscience.cdk.interfaces.IPDBAtom;
import org.openscience.cdk.interfaces.IPDBMonomer;
Expand Down Expand Up @@ -206,21 +205,6 @@ private <T extends ICDKObject>T newAtomContainerInstance(
params[0] instanceof IAtomContainer) {
return (T)new Crystal((IAtomContainer)params[0]);
}
} else if (IMolecule.class.isAssignableFrom(clazz)) {
if (params.length == 0) {
return (T)new Molecule();
} else if (params.length == 1 &&
params[0] instanceof IAtomContainer) {
return (T)new Molecule((IAtomContainer)params[0]);
} else if (params.length == 4 &&
params[0] instanceof Integer &&
params[1] instanceof Integer &&
params[2] instanceof Integer &&
params[3] instanceof Integer) {
return (T)new Molecule(
(Integer)params[0], (Integer)params[1], (Integer)params[2], (Integer)params[3]
);
}
} else if (IRing.class.isAssignableFrom(clazz)) {
if (params.length == 0) {
return (T)new Ring();
Expand Down
109 changes: 0 additions & 109 deletions src/main/org/openscience/cdk/Molecule.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/org/openscience/cdk/charges/Electronegativity.java
Expand Up @@ -24,7 +24,6 @@
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IMolecule;

/**
* Calculation of the electronegativity of orbitals of a molecule
Expand Down Expand Up @@ -103,7 +102,7 @@ public double calculateSigmaElectronegativity(IAtomContainer ac,

try {
if(!ac.equals(acOldS)){
molSigma = ac.getBuilder().newInstance(IMolecule.class,ac);
molSigma = ac.getBuilder().newInstance(IAtomContainer.class,ac);
peoe.setMaxGasteigerIters(maxI);
peoe.assignGasteigerMarsiliSigmaPartialCharges(molSigma, true);
marsiliFactors = peoe.assignGasteigerSigmaMarsiliFactors(molSigma);
Expand Down
Expand Up @@ -23,6 +23,11 @@
*/
package org.openscience.cdk.charges;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
Expand All @@ -34,7 +39,6 @@
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
import org.openscience.cdk.reaction.type.HeterolyticCleavagePBReaction;
Expand All @@ -48,11 +52,6 @@
import org.openscience.cdk.tools.StructureResonanceGenerator;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
* <p>The calculation of the Gasteiger (PEPE) partial charges is based on
* {@cdk.cite Saller85}. This class doesn't implement the original method of the Marsili but the
Expand Down Expand Up @@ -200,7 +199,7 @@ public IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean

/*find resonance containers, which eliminates the repetitions*/
StructureResonanceGenerator gRN = new StructureResonanceGenerator();/*according G. should be integrated the breaking bonding*/
IAtomContainerSet acSet = gRN.getContainers((IMolecule) removingFlagsAromaticity(ac));
IAtomContainerSet acSet = gRN.getContainers(removingFlagsAromaticity(ac));
// IAtomContainerSet acSet = ConjugatedPiSystemsDetector.detect(removingFlagsAromaticity(ac));

IAtomContainerSet iSet = ac.getBuilder().newInstance(IAtomContainerSet.class);
Expand Down Expand Up @@ -519,7 +518,7 @@ private IAtomContainerSet getHyperconjugationInteractions(IAtomContainer ac, IAt
return null;


setOfReactants.addAtomContainer((IMolecule) ac);
setOfReactants.addAtomContainer(ac);

List<IParameterReact> paramList = new ArrayList<IParameterReact>();
IParameterReact param = new SetReactionCenter();
Expand Down
Expand Up @@ -21,13 +21,12 @@
*/
package org.openscience.cdk.charges;

import java.util.Map;
import java.util.List;
import java.util.Map;

import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.modeling.builder3d.ForceFieldConfigurator;

/**
Expand Down Expand Up @@ -73,7 +72,7 @@ public MMFF94PartialCharges() { }
public IAtomContainer assignMMFF94PartialCharges(IAtomContainer ac) throws Exception {
ForceFieldConfigurator ffc = new ForceFieldConfigurator();
ffc.setForceFieldConfigurator("mmff94");
ffc.assignAtomTyps((IMolecule)ac);
ffc.assignAtomTyps(ac);
Map<String,Object> parameterSet = ffc.getParameterSet();
// for this calculation,
// we need some values stored in the vector "data" in the
Expand Down
37 changes: 0 additions & 37 deletions src/main/org/openscience/cdk/interfaces/IMolecule.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/org/openscience/cdk/io/CTXReader.java
Expand Up @@ -41,7 +41,6 @@
import org.openscience.cdk.interfaces.IChemModel;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IChemSequence;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.formats.CTXFormat;
import org.openscience.cdk.io.formats.IResourceFormat;
import org.openscience.cdk.tools.ILoggingTool;
Expand Down Expand Up @@ -125,7 +124,7 @@ private IChemFile readChemFile() throws CDKException {
IChemSequence seq = file.getBuilder().newInstance(IChemSequence.class);
IChemModel model = file.getBuilder().newInstance(IChemModel.class);
IAtomContainerSet containerSet = file.getBuilder().newInstance(IAtomContainerSet.class);
IMolecule container = file.getBuilder().newInstance(IMolecule.class);
IAtomContainer container = file.getBuilder().newInstance(IAtomContainer.class);

int lineNumber = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/main/org/openscience/cdk/io/PCCompoundASNReader.java
Expand Up @@ -38,13 +38,13 @@
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
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.IChemSequence;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.formats.IResourceFormat;
import org.openscience.cdk.io.formats.PubChemASNFormat;
import org.openscience.cdk.tools.ILoggingTool;
Expand All @@ -67,7 +67,7 @@ public class PCCompoundASNReader extends DefaultChemObjectReader {
private static ILoggingTool logger =
LoggingToolFactory.createLoggingTool(PCCompoundASNReader.class);

IMolecule molecule = null;
IAtomContainer molecule = null;
Map atomIDs = null;

/**
Expand Down Expand Up @@ -144,7 +144,7 @@ private IChemFile readChemFile(IChemFile file) throws Exception {
IChemSequence chemSequence = file.getBuilder().newInstance(IChemSequence.class);
IChemModel chemModel = file.getBuilder().newInstance(IChemModel.class);
IAtomContainerSet moleculeSet = file.getBuilder().newInstance(IAtomContainerSet.class);
molecule = file.getBuilder().newInstance(IMolecule.class);
molecule = file.getBuilder().newInstance(IAtomContainer.class);
atomIDs = new HashMap();

String line = input.readLine();
Expand Down
7 changes: 3 additions & 4 deletions src/main/org/openscience/cdk/io/PCCompoundXMLReader.java
Expand Up @@ -35,7 +35,6 @@
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.io.formats.IResourceFormat;
import org.openscience.cdk.io.formats.PubChemSubstanceXMLFormat;
Expand All @@ -61,7 +60,7 @@ public class PCCompoundXMLReader extends DefaultChemObjectReader {
private PubChemXMLHelper parserHelper;
private IChemObjectBuilder builder;

IMolecule molecule = null;
IAtomContainer molecule = null;

/**
* Construct a new reader from a Reader type object.
Expand Down Expand Up @@ -109,13 +108,13 @@ public void setReader(InputStream input) throws CDKException {
public boolean accepts(Class classObject) {
Class[] interfaces = classObject.getInterfaces();
for (int i=0; i<interfaces.length; i++) {
if (IMolecule.class.equals(interfaces[i])) return true;
if (IAtomContainer.class.equals(interfaces[i])) return true;
}
return false;
}

public <T extends IChemObject> T read(T object) throws CDKException {
if (object instanceof IMolecule) {
if (object instanceof IAtomContainer) {
try {
parserHelper = new PubChemXMLHelper(object.getBuilder());
builder = object.getBuilder();
Expand Down
7 changes: 3 additions & 4 deletions src/main/org/openscience/cdk/io/PCSubstanceXMLReader.java
Expand Up @@ -36,7 +36,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.formats.IResourceFormat;
import org.openscience.cdk.io.formats.PubChemSubstanceXMLFormat;
import org.openscience.cdk.io.pubchemxml.PubChemXMLHelper;
Expand All @@ -61,7 +60,7 @@ public class PCSubstanceXMLReader extends DefaultChemObjectReader {
private PubChemXMLHelper parserHelper;
private IChemObjectBuilder builder;

IMolecule molecule = null;
IAtomContainer molecule = null;

/**
* Construct a new reader from a Reader type object.
Expand Down Expand Up @@ -109,13 +108,13 @@ public void setReader(InputStream input) throws CDKException {
public boolean accepts(Class classObject) {
Class[] interfaces = classObject.getInterfaces();
for (int i=0; i<interfaces.length; i++) {
if (IMolecule.class.equals(interfaces[i])) return true;
if (IAtomContainer.class.equals(interfaces[i])) return true;
}
return false;
}

public <T extends IChemObject> T read(T object) throws CDKException {
if (object instanceof IMolecule) {
if (object instanceof IAtomContainer) {
try {
parserHelper = new PubChemXMLHelper(object.getBuilder());
builder = object.getBuilder();
Expand Down
Expand Up @@ -36,7 +36,6 @@
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.ISimpleChemObjectReader;
import org.openscience.cdk.io.MDLV2000Reader;
import org.openscience.cdk.io.ReaderFactory;
Expand Down

0 comments on commit 2fc6b61

Please sign in to comment.