[
https://issues.apache.org/jira/browse/COLLECTIONS-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13835078#comment-13835078
]
Thomas Neidhart commented on COLLECTIONS-471:
---------------------------------------------
The reason would be consistency. Normally all decorators, see also other
packages, have a static factory method.
But I have to admit that some things are not consistent:
* some decorators have a private constructor, mainly when they are supposed
to be final, e.g. unmodifiable
* some have a protected constructor to allow sub-classing
* some have a public constructor that does not validate the input
This needs to be further cleaned up in a reasonable way. For iterators I am not
yet decided, and another thing to consider is to shift our focus more on
Iterables rather than on Iterators, see COLLECTIONS-442, which I want to tackle
next.
> Add a BoundedIterator which returns at most limit elements
> ----------------------------------------------------------
>
> Key: COLLECTIONS-471
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-471
> Project: Commons Collections
> Issue Type: New Feature
> Reporter: Thomas Neidhart
> Fix For: 4.0.1
>
> Attachments: BoundedIterator.java, BoundedIteratorTest.java
>
>
> 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
(v6.1#6144)