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

List#indexOf(groovy.lang.Closure closure) and friends to groovy jdk

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.2
    • groovy-jdk
    • None

    Description

      find(groovy.lang.Closure closure) and findAll(groovy.lang.Closure closure) methods are really useful. It would be also good to have

      List#indexOf(groovy.lang.Closure closure)
      List#indexOf(int startIndex, groovy.lang.Closure closure) // startIndex tells from which index to start looking
      int[] List#indicesOfAll(groovy.lang.Closure closure) // return type may also be a List<Integer> or whatever
      List#lastIndexOf(groovy.lang.Closure closure)

      in the groovy jdk as it is sometimes important to know where the elements fullfilling the given condition are in the list.

      Attachments

        Activity

          People

            paulk Paul King
            antti.karanta@napa.fi Antti Karanta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: