groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: Calling each()/eachWithIndex() on an object that implements both Iterator and Iterable
Date Tue, 01 Dec 2015 23:21:52 GMT
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
> (www.eclipse.org/emf <http://www.eclipse.org/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

Mime
View raw message