public static List < Number > findIndexValues ( Object self , Number startIndex , Closure closure ) { List < Number > result = new ArrayList < Number > ( ) ; long count = 0 ; long startCount = startIndex . longValue ( ) ; BooleanClosureWrapper bcw = new BooleanClosureWrapper ( closure ) ; for ( Iterator iter = InvokerHelper . asIterator ( self ) ; iter . hasNext ( ) ; count ++ ) { Object value = iter . next ( ) ; if ( count < startCount ) { continue ; } if ( bcw . call ( value ) ) { result . add ( count ) ; } } return result ; }
Iterates over the elements of an iterable collection of items starting from a specified startIndex and returns the index values of the items that match the condition specified in the closure .