commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Commented] (COLLECTIONS-471) Add a BoundedIterator which returns at most limit elements
Date Wed, 27 Nov 2013 22:58:36 GMT


Thomas Neidhart commented on COLLECTIONS-471:

Committed patch with some additional changes in r1546220:

 * added factory methods to be consistent with other decorators
 * added corresponding methods boundedIterator in IteratorUtils
 * remove unneeded variable firstNextCalled: pos can be used for this purpose
 * changed logic of next and hasNext slightly: avoid calling iterator.hasNext twice
 * do not extends AbstractIteratorDecorator: makes code slightly more readable by avoiding
   super.hasNext and and we need to implement all methods anyway thus no real benefit
of extending the decorator.
 * javadoc updates

Thanks for this contribution!

If you have ideas for other useful iterators, feel free to create already another ticket.

> Add a BoundedIterator which returns at most limit elements
> ----------------------------------------------------------
>                 Key: COLLECTIONS-471
>                 URL:
>             Project: Commons Collections
>          Issue Type: New Feature
>            Reporter: Thomas Neidhart
>             Fix For: 4.0.1
>         Attachments:,
> It would be nice to have a decorator which bounds the number of elements returned by
the decorated iterator.

This message was sent by Atlassian JIRA

View raw message