updated the code generator of standard library methods and regenerated it

This commit is contained in:
James Strachan
2012-03-23 11:04:04 +00:00
parent c0cac21b8a
commit b2dd4cd590
8 changed files with 81 additions and 60 deletions
@@ -1,4 +1,4 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt
// NOTE this file is auto-generated from src/JavaCollections.kt
package kotlin
import java.util.*
@@ -1,4 +1,4 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaIterables.kt
// NOTE this file is auto-generated from src/JavaIterables.kt
package kotlin
import kotlin.util.*
@@ -57,9 +57,9 @@ inline fun <T, C: Collection<in T>> Array<T>.filterTo(result: C, predicate: (T)-
}
/** Returns a List containing all the non null elements in this collection */
inline fun <T> Array<T?>?.filterNotNull() : Collection<T> = filterNotNullTo(java.util.ArrayList<T>())
inline fun <T> Array<T?>?.filterNotNull() : Collection<T> = filterNotNullTo<T, java.util.ArrayList<T>>(java.util.ArrayList<T>())
/** Filters all the null elements in this collection winto the given result collection */
/** Filters all the null elements in this collection into the given result collection */
inline fun <T, C: Collection<in T>> Array<T?>?.filterNotNullTo(result: C) : C {
if (this != null) {
for (elem in this) {
@@ -1,4 +1,4 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt
// NOTE this file is auto-generated from src/JavaCollections.kt
package kotlin.util
import java.util.*
@@ -1,4 +1,4 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt
// NOTE this file is auto-generated from src/JavaCollections.kt
package kotlin
import java.util.*
@@ -1,4 +1,4 @@
// NOTE this file is auto-generated from stdlib/ktSrc/JavaIterables.kt
// NOTE this file is auto-generated from src/JavaIterables.kt
package kotlin
import kotlin.util.*
@@ -56,7 +56,19 @@ inline fun <T, C: Collection<in T>> Iterable<T>.filterTo(result: C, predicate: (
return result
}
/** Returns a List containing all the non null elements in this collection */
inline fun <T> Iterable<T?>?.filterNotNull() : Collection<T> = filterNotNullTo<T, java.util.ArrayList<T>>(java.util.ArrayList<T>())
/** Filters all the null elements in this collection into the given result collection */
inline fun <T, C: Collection<in T>> Iterable<T?>?.filterNotNullTo(result: C) : C {
if (this != null) {
for (elem in this) {
if (elem != null)
result.add(elem)
}
}
return result
}
/** Returns a new collection containing all elements in this collection which do not match the given predicate */
inline fun <T> Iterable<T>.filterNot(predicate: (T)-> Boolean) : Collection<T> = filterNotTo(ArrayList<T>(), predicate)