> I did not understand fully how the Bond's Atoms are retrieved... the > API > says it returns an Object... but that's not very informative... moreover, > the > CdkModelAdapter seems to return a CDK Atom there... which does not help me > either... So, what does it return??
At some level, it can be whatever the client wants it to be ... let me explain :-) The AtomIterator calls getUniqueID() for each atom. This value is not really used by the reading code. It is an Object that is to be used as a UniqueID. The BondIterator calls getAtomUid1() and getAtomUid2(). The values returned by these routines are the same as the UIDs previously returned during the AtomIterator. The idea behind this was to make it easy to write a client. The client can return whatever it wants. That is why the CdkModelAdapter was returning a cdk.Atom. On the other side, this is a very good use of a hash table. As you iterate through the Atoms you use a hash table to map the client's atom UIDs to your own data structures. Then, when you iterate through the bonds, you look up in the hash table to get your two atom data structures. When you are all done, free the hash table. Miguel ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers
