Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.5.2
-
Component/s: groovy-jdk
-
Labels:None
-
Number of attachments :
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.
There was already a findIndexOf() method so I added findLastIndexOf() and findIndexValues(). All three variations take an optional start index.