Closed GoogleCodeExporter closed 9 years ago
Unless I'm misunderstanding you, you can just compose consuming* and filter:
Iterable<A> filteredConsuming = Iterables.consumingIterable(
Iterables.filter(iterable, predicate));
Original comment by cgdec...@gmail.com
on 14 Jun 2011 at 3:43
No, because filter returns UnmodifiableIterator. I guess it has to do with
hasNext advancing the unfiltered iterator and closing the window to issue a
remove. It's strange that Iterator doesn't specify whether a remove is valid
after a call to hasNext.
Original comment by andreas....@gmail.com
on 14 Jun 2011 at 4:06
Oh, right... stupid me.
Original comment by cgdec...@gmail.com
on 14 Jun 2011 at 4:14
consumingIterator() is already a fairly niche utility as it is, so I don't
think there's a good place for variations on it in Guava.
Original comment by kevinb@google.com
on 13 Jul 2011 at 6:40
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:09
Original issue reported on code.google.com by
andreas....@gmail.com
on 14 Jun 2011 at 3:19