Hi,
Rajarshi is right (but there is a small typo : there's a stray "=" in
the method call for atoms :)
It's an annoying feature of java that you have to choose between
iterators and iterable. Also, sadly molecules cannot be iterable for
both atoms and bonds, otherwise you could do "for (IAtom atom : mol)
{...}" and "for (IBond bond : mol)" which would be cleaner.
Anyway, it would be helpful if you could file a bug report on the
javadoc for that class, so that other users don't have the same
irritation! :)
gilleain
On Mon, Jul 26, 2010 at 6:29 PM, Rajarshi Guha <[email protected]> wrote:
> On Mon, Jul 26, 2010 at 1:10 PM, Nick Vandewiele
> <[email protected]> wrote:
>> Hi,
>>
>> cdk.tools.CDKHydrogenAdder provides an example on how to add implicit
>> hydrogens to an IAtomContainer.
>>
>> However, when I copy-paste this into my Eclipse workbench, the line:
>>
>> Iterator<IAtom> atoms = methane.atoms();
>
> The idiom to iterate over atoms is
>
> for (IAtom atom : methane.atoms=()) {
> }
>
> --
> Rajarshi Guha
> NIH Chemical Genomics Center
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> Cdk-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user