Hi,
I've noticed that whenever I use the method BondSet.addBond(), The bonds are not added in the order that I added them (chronologically),
but in the order of the bond indices. In other words, it's as if the bonds are sorted once added.
Is this intentional? It seems confusing and somewhat counter-intuitive that this' the case. This isn't mentioned in the documentation
for the API either. I wonder if it's the same for the AtomSet.addAtom() method too...
Here's an example of where this happens (Molecule mol & String[] indices are method arguments):
BondSet bondsOfInterest = new BondSet(mol);
try {
for( int s = 0; s < indices.length; s++ )
bondsOfInterest.addBond( mol.getBond( Integer.parseInt( indices[s] ) ) );
} catch( NumberFormatException e ) {
throw e;
}
return bondsOfInterest;
I've had to modify the method to this in order to actually get the things in chronological order of how they originally were:
Vector
try {
for( int s = 0; s < indices.length; s++ )
bondsOfInterest.add( mol.getBond( Integer.parseInt( indices[s] ) ) );
} catch( NumberFormatException e ) {
throw e;
}
return bondsOfInterest;
Thanks in advance,
Ed.
