Closed GoogleCodeExporter closed 9 years ago
Thanks for the suggestion. When I think about how to include lower_bound and
upper_bound logic in the Google Collection Library, a few ideas come to mind, in
addition to the Ordering methods you proposed.
We could supply SortedIterator and SortedIterable classes, to handle the common
case
when the elements are ordered but don't belong to a SortedSet. Internally,
Google has
a little-used, preliminary version of those.
As a different approach, there could be Iterators.filterContiguous(Iterator,
Predicate) and Iterables.filterContiguous(Iterable, Predicate) methods, which
select
the elements of the iterator or iterable up to the first element that doesn't
satisfy
the predicate.
For any predicate-based approach, it would be convenient to have methods like
Predicate.lessThan(Number) to create the needed Predicate.
Original comment by jared.l....@gmail.com
on 15 Aug 2009 at 6:21
Generalizing the subject. Although our OrderedIterators stuff is little-used
internally, I believe it will be better-used once we take the time to promote
it. I'm
a strong believer in the value of the code. When we release it, it will
include the
ability to view a subiterator limited to a particular interval. This will take
a while
though.
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 4:59
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 5:45
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 5:57
This issue has been moved to the Guava project (keeping the same id number).
Simply replace 'google-collections' with 'guava-libraries' in your address
bar and it should take you there.
Original comment by kevinb@google.com
on 5 Jan 2010 at 11:09
Original issue reported on code.google.com by
balca...@gmail.com
on 15 Aug 2009 at 9:20