groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Dorner <>
Subject Re: Calling each()/eachWithIndex() on an object that implements both Iterator and Iterable
Date Thu, 03 Dec 2015 13:35:16 GMT
Ok so I'd basically override the provided methods. I thought about the
same, I'll try.

On Wed, Dec 2, 2015 at 12:21 AM, Jochen Theodorou <> wrote:

> Am 28.11.2015 um 01:25 schrieb Felix Dorner:
>> Hi,
>> I'm a new Groovy user. I am trying to use Groovy in the context of EMF
>> ( <>). This framework
>> includes a utility class ContentTreeIterator which implements Iterator
>> and Iterable at the same time. Clients are supposed to access instances
>> through the Iterator interface. (Using the iterator that's retuned by
>> iterator() will yield different results than using the object itself as
>> the iterator).
> Since a cast won't work in that situation the only thing I can imagine
> would be to use an extension method working on ContentTreeIterator or maybe
> even better on AbstractTreeIterator, if I have seen right in the javadoc.
> bye Jochen

Linux. The choice of a GNU generation.

View raw message