commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [collections] IteratorChain(Iterator) should be meta!
Date Sun, 02 Jul 2006 10:06:51 GMT
IteratorChain is the right class, but the constructor just adds the one 

You could use the Iterator(Collection) constructor which adds a 
collection of Iterators. Perhaps use IteratorUtils.toList to create the 

Alternatively, you could patch IteratorChain to add a factory method 
that takes an iterator and does what you wanted.


Paul Libbrecht wrote:
> Hello,
> only after a looong quest I realized that new IteratorChain(Iterator) 
> will only iterate through the elements of the given iterator instead of 
> expecting that each element is an iterator itself through which one 
> iterates.
> Am I blurred to expect such ?
> I suppose that changing this behaviour would be a too strong API 
> change... so should one do an IteratorThroughIterators?? I can offer a 
> class... if wished.
> paul

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message