You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2013/04/28 16:00:16 UTC

[jira] [Comment Edited] (COLLECTIONS-296) Introduce SortedUtils.merge() for merging sorted collections

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

Thomas Neidhart edited comment on COLLECTIONS-296 at 4/28/13 2:00 PM:
----------------------------------------------------------------------

I did improve the implementation by re-using a CollatingIterator, and also decided to rename the merge methods to collate, which is clearer imho (in r1476770).
                
      was (Author: tn):
    I did improve the implementation by re-using a CollatingIterator, and also decided to rename the merge methods to collate, which is clearer imho.
                  
> Introduce SortedUtils.merge() for merging sorted collections
> ------------------------------------------------------------
>
>                 Key: COLLECTIONS-296
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-296
>             Project: Commons Collections
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Julius Davies
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: SortedUtils.patch
>
>
> Is there any interest in this?
>     /**
>      * Returns a new ArrayList where sorted Collection a and sorted Collection b
>      * are combined such that ordering of the elements according to
>      * Comparator c is retained.  Uses the standard O(n) merge algorithm
>      * for combining two sorted lists.
>      *
>      * @param a Object to combine with sorted Collection b.  Must implement Comparable.
>      * @param b Sorted Collection to combine with Object a.
>      * @param c Comparator by which Collection a and Collection b have been sorted, or null
>      *          if the Collections are sorted according to their natural ordering.
>      * @return a new sorted ArrayList
>      */
>     public static ArrayList merge(Collection a, Collection b, Comparator c);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira