User 870ab5b546
05-04-2013 15:59:39
Consider this molecule:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6" elementType="C C Pd X P P" sgroupRef="sg1 sg1 0 0 0 0" x2="2.40625 2.40625 0.24062499403953552 2.40625 -1.2113009299968418 -1.2113009299968418" y2="2.117500066757202 0.5775000667572021 1.3956249952316284 1.3475000667572021 2.8475509192680057 -0.05630092880474913"/>
<bondArray>
<bond atomRefs2="a1 a2" order="2"/>
<bond atomRefs2="a4 a3" convention="cxn:coord"/>
<bond atomRefs2="a5 a3" convention="cxn:coord"/>
<bond atomRefs2="a6 a3" convention="cxn:coord"/>
</bondArray>
<molecule id="sg1" role="MulticenterSgroup" molID="m2" atomRefs="a1 a2" center="a4"/>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
getAtomCount() returns 6, an incredibly counterintuitive result. I understand why you need to have a method that returns this value, so I propose that you make a new method, Molecule.getAtomCount(boolean realAtomsOnly), where a value of true will count only the real atoms in the compound, and a value of false will return a number that includes the Sgroups, multicenter attachment points, etc.