move coverage of the standard methods across Iterable, Array, java.util.Iterable (not quite complete but close)

This commit is contained in:
James Strachan
2011-12-23 15:46:41 +00:00
parent 5242985e2e
commit 877de17122
7 changed files with 152 additions and 38 deletions
@@ -0,0 +1,11 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt
package std.util
import java.util.*
/** Returns a new collection containing the results of applying the given function to each element in this collection */
inline fun <T, R> java.lang.Iterable<T>.map(result: Collection<R> = ArrayList<R>(), transform : (T) -> R) : Collection<R> {
for (item in this)
result.add(transform(item))
return result
}