From: <raj...@us...> - 2008-09-16 07:46:18
|
Revision: 12331 http://cdk.svn.sourceforge.net/cdk/?rev=12331&view=rev Author: rajarshi Date: 2008-09-16 14:46:13 +0000 (Tue, 16 Sep 2008) Log Message: ----------- Used bond iterable rathe than iterator Modified Paths: -------------- cdk/branches/cdk-1.2.x/src/main/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java Modified: cdk/branches/cdk-1.2.x/src/main/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java =================================================================== --- cdk/branches/cdk-1.2.x/src/main/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java 2008-09-16 01:50:36 UTC (rev 12330) +++ cdk/branches/cdk-1.2.x/src/main/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java 2008-09-16 14:46:13 UTC (rev 12331) @@ -40,8 +40,6 @@ import org.openscience.cdk.qsar.result.IntegerResult; import org.openscience.cdk.tools.manipulator.BondManipulator; -import java.util.Iterator; - /** * The number of rotatable bonds is given by the SMARTS specified by Daylight on * <a href="http://www.daylight.com/dayhtml_tutorials/languages/smarts/smarts_examples.html#EXMPL">SMARTS tutorial</a><p> @@ -142,7 +140,6 @@ */ public DescriptorValue calculate(IAtomContainer ac) { int rotatableBondsCount = 0; - Iterator<IBond> bonds = ac.bonds().iterator(); int degree0; int degree1; IRingSet ringSet; @@ -152,15 +149,12 @@ return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult((int) Double.NaN), getDescriptorNames(), e); } - while (bonds.hasNext()) { - IBond bond = (IBond)bonds.next(); + for (IBond bond : ac.bonds()) { if (ringSet.getRings(bond).getAtomContainerCount() > 0) { bond.setFlag(CDKConstants.ISINRING, true); } } - bonds = ac.bonds().iterator(); - while (bonds.hasNext()) { - IBond bond = (IBond)bonds.next(); + for (IBond bond : ac.bonds()) { IAtom atom0 = bond.getAtom(0); IAtom atom1 = bond.getAtom(1); if (bond.getOrder() == CDKConstants.BONDORDER_SINGLE) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |