Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Code clean up: use IMolecule interface, and properly typed List

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
commit 6ae652f090ef7bd281c8837c77e2b03c1d913757 1 parent 98e4cae
@egonw egonw authored rajarshi committed
View
1  src/META-INF/qsar.cdkdepends
@@ -1,6 +1,5 @@
cdk-annotation.jar
cdk-interfaces.jar
-cdk-data.jar
cdk-core.jar
cdk-standard.jar
cdk-valencycheck.jar
View
17 src/main/org/openscience/cdk/qsar/descriptors/atompair/PiContactDetectionDescriptor.java
@@ -1,6 +1,5 @@
-/* $Revision$ $Author$ $Date$
- *
- * Copyright (C) 2004-2007 The Chemistry Development Kit (CDK) project
+/* Copyright (C) 2004-2007 The Chemistry Development Kit (CDK) project
+ * 2011 Egon Willighagen <egonw@users.sf.net>
*
* Contact: cdk-devel@lists.sourceforge.net
*
@@ -20,7 +19,8 @@
*/
package org.openscience.cdk.qsar.descriptors.atompair;
-import org.openscience.cdk.Molecule;
+import java.util.List;
+
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector;
import org.openscience.cdk.exception.CDKException;
@@ -28,6 +28,7 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
+import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.qsar.DescriptorSpecification;
import org.openscience.cdk.qsar.DescriptorValue;
import org.openscience.cdk.qsar.IAtomPairDescriptor;
@@ -155,7 +156,7 @@ public DescriptorValue calculate(IAtom first, IAtom second, IAtomContainer atomC
IAtom clonedFirst = ac.getAtom(atomContainer.getAtomNumber(first));
IAtom clonedSecond = ac.getAtom(atomContainer.getAtomNumber(first));
- Molecule mol = new Molecule(ac);
+ IMolecule mol = ac.getBuilder().newInstance(IMolecule.class, ac);
if (checkAromaticity) {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
@@ -203,11 +204,11 @@ public DescriptorValue calculate(IAtom first, IAtom second, IAtomContainer atomC
* @param ac AtomContainer
* @return The boolean result
*/
- private boolean isANeighboorsInAnAtomContainer(java.util.List neighs, IAtomContainer ac) {
+ private boolean isANeighboorsInAnAtomContainer(List<IAtom> neighs, IAtomContainer ac) {
boolean isIn = false;
int count = 0;
- for (Object neigh : neighs) {
- if (ac.contains((IAtom) neigh)) {
+ for (IAtom neigh : neighs) {
+ if (ac.contains(neigh)) {
count += 1;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.