commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COLLECTIONS-667) CollectionUtils Concat Method
Date Tue, 02 Jan 2018 23:04:00 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308860#comment-16308860
] 

BELUGA BEHR commented on COLLECTIONS-667:
-----------------------------------------

Something akin to [IteratorUtils|https://commons.apache.org/proper/commons-collections/javadocs/api-release/org/apache/commons/collections4/IteratorUtils.html#chainedIterator(java.util.Iterator...)].

{code}
public Collection concat(Collection c...) {
ArrayList results = new ArrayList():
for (Collection a : c) {
   results.addAll(a);
}
return results;
{code}

* May want to size the ArrayList first to avoid having to expand the internal buffer multiple
times
* Maybe create a new Collection object that keeps a pointer to each internal Collection

> CollectionUtils Concat Method
> -----------------------------
>
>                 Key: COLLECTIONS-667
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-667
>             Project: Commons Collections
>          Issue Type: New Feature
>          Components: Collection
>            Reporter: BELUGA BEHR
>            Priority: Minor
>
> Add a _concat_ method which returns a Collection of all the Collections in the argument
list
> {code}
> public Collection concat(Collection c...)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message