Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5
    • Fix Version/s: 1.8.6, 2.0-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      I have often found a need for collating or partitioning a List into a List of sub-lists of a given size.

      This question has been asked on StackOverflow a couple of times as well

      ie:

      [1,2,3,4,5].collate( 3 ) == [ [ 1, 2, 3 ], [ 4, 5 ] ]
      

      This could be chained to generate a multi-dimensional list of lists, ie:

      (1..9).collate( 3 ).collate( 2 ) == [ [ [1,2,3], [4,5,6] ],
                                            [ [7,8,9]          ] ]
      

        Activity

        Tim Yates created issue -
        Hide
        Tim Yates added a comment -

        And this generated my first pull request of (hopefully) many:

        https://github.com/groovy/groovy-core/pull/22

        Show
        Tim Yates added a comment - And this generated my first pull request of (hopefully) many: https://github.com/groovy/groovy-core/pull/22
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Assignee Guillaume Laforge [ guillaume ]
        Hide
        Guillaume Delcroix added a comment -

        Thank you Tim!

        Show
        Guillaume Delcroix added a comment - Thank you Tim!
        Guillaume Delcroix made changes -
        Fix Version/s 2.0-beta-3 [ 18244 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.8.6 [ 18245 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734206 ] Default workflow, editable Closed status [ 12746005 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12971722 ] Default workflow, editable Closed status [ 12979497 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        5h 44m 1 Guillaume Delcroix 06/Feb/12 15:14
        Resolved Resolved Closed Closed
        5d 12h 48m 1 Paul King 12/Feb/12 04:03

          People

          • Assignee:
            Guillaume Delcroix
            Reporter:
            Tim Yates
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development