Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6863

Move methods from Collection to Iterable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.0-beta-2
    • groovy-jdk
    • None
    • Patch

    Description

      Move many methods from Collection to Iterable.

      Added these methods to Iterable.

      contains(Object)
      containsAll(Object[])
      eachPermutation(Closure)
      inject(Closure)
      head()
      tail()
      asCollection()
      plus(Iterable)
      plus(Object)
      multiply(Number)
      intersect(Iterable)
      toSet()

      Deprecated this method from Collection.

      eachPermutation(Closure)

      Did not add these methods to Iterable because GPathResult conflicts.
      Read https://github.com/groovy/groovy-core/pull/444 for the detail.

      toListString()
      toListString(int)

      I also added this method.

      DefaultGroovyMethodsSupport.createSimilarCollection(Iterable)

      I cannot move these methods because they exists in Object
      and Groovy cannot handle properly if I move them from Collection to Iterable.

      grep(Object)
      grep()
      collect(Closure)
      collect()
      collect(Collection, Closure)
      find(Closure)
      find()
      findResult(Object, Closure)
      findResult(Closure)
      findAll(Closure)
      findAll()
      split(Closure)
      inject(Closure)
      inject(Object, Closure)

      The pull request is here.
      https://github.com/groovy/groovy-core/pull/444

      Attachments

        Activity

          People

            paulk Paul King
            yukoba Yu Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: