Added 'public' annotation and specified return types for library functions

This commit is contained in:
Svetlana Isakova
2012-03-29 20:45:59 +04:00
parent aefabd132e
commit 167a9c444a
55 changed files with 1435 additions and 1435 deletions
@@ -15,12 +15,12 @@ import java.util.*
*
* @includeFunction ../../test/CollectionTest.kt map
*/
inline fun <T, R> Array<T>.map(transform : (T) -> R) : java.util.List<R> {
public inline fun <T, R> Array<T>.map(transform : (T) -> R) : java.util.List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
/** Transforms each element of this collection with the given function then adds the results to the given collection */
inline fun <T, R, C: Collection<in R>> Array<T>.mapTo(result: C, transform : (T) -> R) : C {
public inline fun <T, R, C: Collection<in R>> Array<T>.mapTo(result: C, transform : (T) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -15,12 +15,12 @@ import java.util.*
*
* @includeFunction ../../test/CollectionTest.kt map
*/
inline fun <T, R> java.lang.Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
public inline fun <T, R> java.lang.Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
return mapTo(java.util.ArrayList<R>(), transform)
}
/** Transforms each element of this collection with the given function then adds the results to the given collection */
inline fun <T, R, C: Collection<in R>> java.lang.Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
public inline fun <T, R, C: Collection<in R>> java.lang.Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -15,12 +15,12 @@ import java.util.*
*
* @includeFunction ../../test/CollectionTest.kt map
*/
inline fun <T, R> Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
public inline fun <T, R> Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
return mapTo(java.util.ArrayList<R>(), transform)
}
/** Transforms each element of this collection with the given function then adds the results to the given collection */
inline fun <T, R, C: Collection<in R>> Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
public inline fun <T, R, C: Collection<in R>> Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
for (item in this)
result.add(transform(item))
return result