From 3fb74d3e691a20ac3dcfc154aebaf3861caa6c15 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Mon, 2 Apr 2012 15:25:15 +0100 Subject: [PATCH] renamed @includeFunction to @includeFunctionBody to be more clear that the function definition itself won't be included into the kdocs --- .../jetbrains/kotlin/doc/model/KotlinModel.kt | 2 +- .../generated/ArraysFromJavaCollections.kt | 2 +- .../src/generated/ArraysFromJavaIterables.kt | 26 +++++++++---------- .../generated/ArraysFromJavaIterablesLazy.kt | 14 +++++----- .../JavaUtilIterablesFromJavaCollections.kt | 2 +- .../JavaUtilIteratorsFromJavaIterables.kt | 26 +++++++++---------- .../generated/StandardFromJavaCollections.kt | 2 +- .../generated/StandardFromJavaIterables.kt | 26 +++++++++---------- .../StandardFromJavaIterablesLazy.kt | 14 +++++----- libraries/stdlib/src/kotlin/Iterators.kt | 14 +++++----- libraries/stdlib/src/kotlin/JUMaps.kt | 4 +-- .../stdlib/src/kotlin/JavaCollections.kt | 2 +- libraries/stdlib/src/kotlin/JavaIterables.kt | 26 +++++++++---------- .../stdlib/src/kotlin/JavaIterablesLazy.kt | 14 +++++----- .../stdlib/src/kotlin/JavaIterablesSpecial.kt | 2 +- 15 files changed, 88 insertions(+), 88 deletions(-) diff --git a/libraries/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/model/KotlinModel.kt b/libraries/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/model/KotlinModel.kt index bd6b8f65858..b8eb527a971 100644 --- a/libraries/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/model/KotlinModel.kt +++ b/libraries/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/model/KotlinModel.kt @@ -392,7 +392,7 @@ class KModel(var context: BindingContext, val config: KDocConfig) { // lets check for javadoc style @ tags and macros if (text.startsWith("@")) { val remaining = text.substring(1) - val macro = "includeFunction" + val macro = "includeFunctionBody" if (remaining.startsWith(macro)) { val next = remaining.substring(macro.length()).trim() val words = next.split("\\s") diff --git a/libraries/stdlib/src/generated/ArraysFromJavaCollections.kt b/libraries/stdlib/src/generated/ArraysFromJavaCollections.kt index 120d8247c20..f4966338ecf 100644 --- a/libraries/stdlib/src/generated/ArraysFromJavaCollections.kt +++ b/libraries/stdlib/src/generated/ArraysFromJavaCollections.kt @@ -13,7 +13,7 @@ import java.util.* /** * Returns a new List containing the results of applying the given function to each element in this collection * - * @includeFunction ../../test/CollectionTest.kt map + * @includeFunctionBody ../../test/CollectionTest.kt map */ public inline fun Array.map(transform : (T) -> R) : java.util.List { return mapTo(java.util.ArrayList(this.size), transform) diff --git a/libraries/stdlib/src/generated/ArraysFromJavaIterables.kt b/libraries/stdlib/src/generated/ArraysFromJavaIterables.kt index b56f7307b5c..57e3abdaef7 100644 --- a/libraries/stdlib/src/generated/ArraysFromJavaIterables.kt +++ b/libraries/stdlib/src/generated/ArraysFromJavaIterables.kt @@ -8,7 +8,7 @@ import java.util.* /** * Returns *true* if any elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt any + * @includeFunctionBody ../../test/CollectionTest.kt any */ public inline fun Array.any(predicate: (T) -> Boolean) : Boolean { for (element in this) if (predicate(element)) return true @@ -18,7 +18,7 @@ public inline fun Array.any(predicate: (T) -> Boolean) : Boolean { /** * Returns *true* if all elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt all + * @includeFunctionBody ../../test/CollectionTest.kt all */ public inline fun Array.all(predicate: (T) -> Boolean) : Boolean { for (element in this) if (!predicate(element)) return false @@ -28,7 +28,7 @@ public inline fun Array.all(predicate: (T) -> Boolean) : Boolean { /** * Returns the number of elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt count + * @includeFunctionBody ../../test/CollectionTest.kt count */ public inline fun Array.count(predicate: (T) -> Boolean) : Int { var count = 0 @@ -39,7 +39,7 @@ public inline fun Array.count(predicate: (T) -> Boolean) : Int { /** * Returns the first element which matches the given *predicate* or *null* if none matched * - * @includeFunction ../../test/CollectionTest.kt find + * @includeFunctionBody ../../test/CollectionTest.kt find */ public inline fun Array.find(predicate: (T) -> Boolean) : T? { for (element in this) if (predicate(element)) return element @@ -49,7 +49,7 @@ public inline fun Array.find(predicate: (T) -> Boolean) : T? { /** * Filters all elements which match the given predicate into the given list * - * @includeFunction ../../test/CollectionTest.kt filterIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList */ public inline fun > Array.filterTo(result: C, predicate: (T) -> Boolean) : C { for (element in this) if (predicate(element)) result.add(element) @@ -59,7 +59,7 @@ public inline fun > Array.filterTo(result: C, predicat /** * Returns a list containing all elements which do not match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filterNotIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList */ public inline fun > Array.filterNotTo(result: L, predicate: (T) -> Boolean) : L { for (element in this) if (!predicate(element)) result.add(element) @@ -69,7 +69,7 @@ public inline fun > Array.filterNotTo(result: L, predicate: /** * Filters all non-*null* elements into the given list * - * @includeFunction ../../test/CollectionTest.kt filterNotNullIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList */ public inline fun > Array?.filterNotNullTo(result: L) : L { if (this != null) { @@ -81,7 +81,7 @@ public inline fun > Array?.filterNotNullTo(result: L) : L { /** * Returns the result of transforming each element to one or more values which are concatenated together into a single list * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun Array.flatMapTo(result: Collection, transform: (T) -> Collection) : Collection { for (element in this) { @@ -96,14 +96,14 @@ public inline fun Array.flatMapTo(result: Collection, transform: (T /** * Performs the given *operation* on each element * - * @includeFunction ../../test/CollectionTest.kt forEach + * @includeFunctionBody ../../test/CollectionTest.kt forEach */ public inline fun Array.forEach(operation: (T) -> Unit) : Unit = for (element in this) operation(element) /** * Folds all elements from from left to right with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt fold + * @includeFunctionBody ../../test/CollectionTest.kt fold */ public inline fun Array.fold(initial: T, operation: (T, T) -> T): T { var answer = initial @@ -114,14 +114,14 @@ public inline fun Array.fold(initial: T, operation: (T, T) -> T): T { /** * Folds all elements from right to left with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt foldRight + * @includeFunctionBody ../../test/CollectionTest.kt foldRight */ public inline fun Array.foldRight(initial: T, operation: (T, T) -> T): T = reverse().fold(initial, operation) /** * Transforms each element using the result as the key in a map to group elements by the result * - * @includeFunction ../../test/CollectionTest.kt groupBy + * @includeFunctionBody ../../test/CollectionTest.kt groupBy */ public inline fun Array.groupBy(result: Map> = HashMap>(), toKey: (T) -> K) : Map> { for (element in this) { @@ -141,7 +141,7 @@ public inline fun > Array.takeWhileTo(result: L, predicate: /** * Reverses the order the elements into a list * - * @includeFunction ../../test/CollectionTest.kt reverse + * @includeFunctionBody ../../test/CollectionTest.kt reverse */ public inline fun Array.reverse() : List { val answer = LinkedList() diff --git a/libraries/stdlib/src/generated/ArraysFromJavaIterablesLazy.kt b/libraries/stdlib/src/generated/ArraysFromJavaIterablesLazy.kt index cf12eae38a9..5fddaca0804 100644 --- a/libraries/stdlib/src/generated/ArraysFromJavaIterablesLazy.kt +++ b/libraries/stdlib/src/generated/ArraysFromJavaIterablesLazy.kt @@ -17,35 +17,35 @@ import java.util.List /** * Returns a list containing all elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filter + * @includeFunctionBody ../../test/CollectionTest.kt filter */ public inline fun Array.filter(predicate: (T) -> Boolean) : List = filterTo(ArrayList(), predicate) /** * Returns a list containing all elements which do not match the given predicate * - * @includeFunction ../../test/CollectionTest.kt filterNot + * @includeFunctionBody ../../test/CollectionTest.kt filterNot */ public inline fun Array.filterNot(predicate: (T)-> Boolean) : List = filterNotTo(ArrayList(), predicate) /** * Returns a list containing all the non-*null* elements * - * @includeFunction ../../test/CollectionTest.kt filterNotNull + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNull */ public inline fun Array?.filterNotNull() : List = filterNotNullTo>(java.util.ArrayList()) /** * Returns the result of transforming each element to one or more values which are concatenated together into a single collection * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun Array.flatMap(transform: (T)-> Collection) : Collection = flatMapTo(ArrayList(), transform) /** * Returns a list containing the first *n* elements * - * @includeFunction ../../test/CollectionTest.kt take + * @includeFunctionBody ../../test/CollectionTest.kt take */ public inline fun Array.take(n: Int): List { fun countTo(n: Int): (T) -> Boolean { @@ -58,14 +58,14 @@ public inline fun Array.take(n: Int): List { /** * Returns a list containing the first elements that satisfy the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt takeWhile + * @includeFunctionBody ../../test/CollectionTest.kt takeWhile */ public inline fun Array.takeWhile(predicate: (T) -> Boolean): List = takeWhileTo(ArrayList(), predicate) /** * Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied * - * @includeFunction ../../test/CollectionTest.kt join + * @includeFunctionBody ../../test/CollectionTest.kt join */ public inline fun Array.join(separator: String = ", ", prefix: String = "", postfix: String = "") : String { val buffer = StringBuilder(prefix) diff --git a/libraries/stdlib/src/generated/JavaUtilIterablesFromJavaCollections.kt b/libraries/stdlib/src/generated/JavaUtilIterablesFromJavaCollections.kt index 0808f6bfedb..4d4561abf2c 100644 --- a/libraries/stdlib/src/generated/JavaUtilIterablesFromJavaCollections.kt +++ b/libraries/stdlib/src/generated/JavaUtilIterablesFromJavaCollections.kt @@ -13,7 +13,7 @@ import java.util.* /** * Returns a new List containing the results of applying the given function to each element in this collection * - * @includeFunction ../../test/CollectionTest.kt map + * @includeFunctionBody ../../test/CollectionTest.kt map */ public inline fun java.lang.Iterable.map(transform : (T) -> R) : java.util.List { return mapTo(java.util.ArrayList(), transform) diff --git a/libraries/stdlib/src/generated/JavaUtilIteratorsFromJavaIterables.kt b/libraries/stdlib/src/generated/JavaUtilIteratorsFromJavaIterables.kt index 19cee700c7d..954670f367b 100644 --- a/libraries/stdlib/src/generated/JavaUtilIteratorsFromJavaIterables.kt +++ b/libraries/stdlib/src/generated/JavaUtilIteratorsFromJavaIterables.kt @@ -6,7 +6,7 @@ import java.util.* /** * Returns *true* if any elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt any + * @includeFunctionBody ../../test/CollectionTest.kt any */ public inline fun java.util.Iterator.any(predicate: (T) -> Boolean) : Boolean { for (element in this) if (predicate(element)) return true @@ -16,7 +16,7 @@ public inline fun java.util.Iterator.any(predicate: (T) -> Boolean) : Boo /** * Returns *true* if all elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt all + * @includeFunctionBody ../../test/CollectionTest.kt all */ public inline fun java.util.Iterator.all(predicate: (T) -> Boolean) : Boolean { for (element in this) if (!predicate(element)) return false @@ -26,7 +26,7 @@ public inline fun java.util.Iterator.all(predicate: (T) -> Boolean) : Boo /** * Returns the number of elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt count + * @includeFunctionBody ../../test/CollectionTest.kt count */ public inline fun java.util.Iterator.count(predicate: (T) -> Boolean) : Int { var count = 0 @@ -37,7 +37,7 @@ public inline fun java.util.Iterator.count(predicate: (T) -> Boolean) : I /** * Returns the first element which matches the given *predicate* or *null* if none matched * - * @includeFunction ../../test/CollectionTest.kt find + * @includeFunctionBody ../../test/CollectionTest.kt find */ public inline fun java.util.Iterator.find(predicate: (T) -> Boolean) : T? { for (element in this) if (predicate(element)) return element @@ -47,7 +47,7 @@ public inline fun java.util.Iterator.find(predicate: (T) -> Boolean) : T? /** * Filters all elements which match the given predicate into the given list * - * @includeFunction ../../test/CollectionTest.kt filterIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList */ public inline fun > java.util.Iterator.filterTo(result: C, predicate: (T) -> Boolean) : C { for (element in this) if (predicate(element)) result.add(element) @@ -57,7 +57,7 @@ public inline fun > java.util.Iterator.filterTo(result /** * Returns a list containing all elements which do not match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filterNotIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList */ public inline fun > java.util.Iterator.filterNotTo(result: L, predicate: (T) -> Boolean) : L { for (element in this) if (!predicate(element)) result.add(element) @@ -67,7 +67,7 @@ public inline fun > java.util.Iterator.filterNotTo(result: L /** * Filters all non-*null* elements into the given list * - * @includeFunction ../../test/CollectionTest.kt filterNotNullIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList */ public inline fun > java.util.Iterator?.filterNotNullTo(result: L) : L { if (this != null) { @@ -79,7 +79,7 @@ public inline fun > java.util.Iterator?.filterNotNullTo(res /** * Returns the result of transforming each element to one or more values which are concatenated together into a single list * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun java.util.Iterator.flatMapTo(result: Collection, transform: (T) -> Collection) : Collection { for (element in this) { @@ -94,14 +94,14 @@ public inline fun java.util.Iterator.flatMapTo(result: Collection, /** * Performs the given *operation* on each element * - * @includeFunction ../../test/CollectionTest.kt forEach + * @includeFunctionBody ../../test/CollectionTest.kt forEach */ public inline fun java.util.Iterator.forEach(operation: (T) -> Unit) : Unit = for (element in this) operation(element) /** * Folds all elements from from left to right with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt fold + * @includeFunctionBody ../../test/CollectionTest.kt fold */ public inline fun java.util.Iterator.fold(initial: T, operation: (T, T) -> T): T { var answer = initial @@ -112,14 +112,14 @@ public inline fun java.util.Iterator.fold(initial: T, operation: (T, T) - /** * Folds all elements from right to left with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt foldRight + * @includeFunctionBody ../../test/CollectionTest.kt foldRight */ public inline fun java.util.Iterator.foldRight(initial: T, operation: (T, T) -> T): T = reverse().fold(initial, operation) /** * Transforms each element using the result as the key in a map to group elements by the result * - * @includeFunction ../../test/CollectionTest.kt groupBy + * @includeFunctionBody ../../test/CollectionTest.kt groupBy */ public inline fun java.util.Iterator.groupBy(result: Map> = HashMap>(), toKey: (T) -> K) : Map> { for (element in this) { @@ -139,7 +139,7 @@ public inline fun > java.util.Iterator.takeWhileTo(result: L /** * Reverses the order the elements into a list * - * @includeFunction ../../test/CollectionTest.kt reverse + * @includeFunctionBody ../../test/CollectionTest.kt reverse */ public inline fun java.util.Iterator.reverse() : List { val answer = LinkedList() diff --git a/libraries/stdlib/src/generated/StandardFromJavaCollections.kt b/libraries/stdlib/src/generated/StandardFromJavaCollections.kt index e0894bdf2e8..e70eb384c77 100644 --- a/libraries/stdlib/src/generated/StandardFromJavaCollections.kt +++ b/libraries/stdlib/src/generated/StandardFromJavaCollections.kt @@ -13,7 +13,7 @@ import java.util.* /** * Returns a new List containing the results of applying the given function to each element in this collection * - * @includeFunction ../../test/CollectionTest.kt map + * @includeFunctionBody ../../test/CollectionTest.kt map */ public inline fun Iterable.map(transform : (T) -> R) : java.util.List { return mapTo(java.util.ArrayList(), transform) diff --git a/libraries/stdlib/src/generated/StandardFromJavaIterables.kt b/libraries/stdlib/src/generated/StandardFromJavaIterables.kt index ea7008c61f3..647ddc3276a 100644 --- a/libraries/stdlib/src/generated/StandardFromJavaIterables.kt +++ b/libraries/stdlib/src/generated/StandardFromJavaIterables.kt @@ -8,7 +8,7 @@ import java.util.* /** * Returns *true* if any elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt any + * @includeFunctionBody ../../test/CollectionTest.kt any */ public inline fun Iterable.any(predicate: (T) -> Boolean) : Boolean { for (element in this) if (predicate(element)) return true @@ -18,7 +18,7 @@ public inline fun Iterable.any(predicate: (T) -> Boolean) : Boolean { /** * Returns *true* if all elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt all + * @includeFunctionBody ../../test/CollectionTest.kt all */ public inline fun Iterable.all(predicate: (T) -> Boolean) : Boolean { for (element in this) if (!predicate(element)) return false @@ -28,7 +28,7 @@ public inline fun Iterable.all(predicate: (T) -> Boolean) : Boolean { /** * Returns the number of elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt count + * @includeFunctionBody ../../test/CollectionTest.kt count */ public inline fun Iterable.count(predicate: (T) -> Boolean) : Int { var count = 0 @@ -39,7 +39,7 @@ public inline fun Iterable.count(predicate: (T) -> Boolean) : Int { /** * Returns the first element which matches the given *predicate* or *null* if none matched * - * @includeFunction ../../test/CollectionTest.kt find + * @includeFunctionBody ../../test/CollectionTest.kt find */ public inline fun Iterable.find(predicate: (T) -> Boolean) : T? { for (element in this) if (predicate(element)) return element @@ -49,7 +49,7 @@ public inline fun Iterable.find(predicate: (T) -> Boolean) : T? { /** * Filters all elements which match the given predicate into the given list * - * @includeFunction ../../test/CollectionTest.kt filterIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList */ public inline fun > Iterable.filterTo(result: C, predicate: (T) -> Boolean) : C { for (element in this) if (predicate(element)) result.add(element) @@ -59,7 +59,7 @@ public inline fun > Iterable.filterTo(result: C, predi /** * Returns a list containing all elements which do not match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filterNotIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList */ public inline fun > Iterable.filterNotTo(result: L, predicate: (T) -> Boolean) : L { for (element in this) if (!predicate(element)) result.add(element) @@ -69,7 +69,7 @@ public inline fun > Iterable.filterNotTo(result: L, predicat /** * Filters all non-*null* elements into the given list * - * @includeFunction ../../test/CollectionTest.kt filterNotNullIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList */ public inline fun > Iterable?.filterNotNullTo(result: L) : L { if (this != null) { @@ -81,7 +81,7 @@ public inline fun > Iterable?.filterNotNullTo(result: L) : /** * Returns the result of transforming each element to one or more values which are concatenated together into a single list * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun Iterable.flatMapTo(result: Collection, transform: (T) -> Collection) : Collection { for (element in this) { @@ -96,14 +96,14 @@ public inline fun Iterable.flatMapTo(result: Collection, transform: /** * Performs the given *operation* on each element * - * @includeFunction ../../test/CollectionTest.kt forEach + * @includeFunctionBody ../../test/CollectionTest.kt forEach */ public inline fun Iterable.forEach(operation: (T) -> Unit) : Unit = for (element in this) operation(element) /** * Folds all elements from from left to right with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt fold + * @includeFunctionBody ../../test/CollectionTest.kt fold */ public inline fun Iterable.fold(initial: T, operation: (T, T) -> T): T { var answer = initial @@ -114,14 +114,14 @@ public inline fun Iterable.fold(initial: T, operation: (T, T) -> T): T { /** * Folds all elements from right to left with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt foldRight + * @includeFunctionBody ../../test/CollectionTest.kt foldRight */ public inline fun Iterable.foldRight(initial: T, operation: (T, T) -> T): T = reverse().fold(initial, operation) /** * Transforms each element using the result as the key in a map to group elements by the result * - * @includeFunction ../../test/CollectionTest.kt groupBy + * @includeFunctionBody ../../test/CollectionTest.kt groupBy */ public inline fun Iterable.groupBy(result: Map> = HashMap>(), toKey: (T) -> K) : Map> { for (element in this) { @@ -141,7 +141,7 @@ public inline fun > Iterable.takeWhileTo(result: L, predicat /** * Reverses the order the elements into a list * - * @includeFunction ../../test/CollectionTest.kt reverse + * @includeFunctionBody ../../test/CollectionTest.kt reverse */ public inline fun Iterable.reverse() : List { val answer = LinkedList() diff --git a/libraries/stdlib/src/generated/StandardFromJavaIterablesLazy.kt b/libraries/stdlib/src/generated/StandardFromJavaIterablesLazy.kt index c68858deb1b..4fbf52e3d80 100644 --- a/libraries/stdlib/src/generated/StandardFromJavaIterablesLazy.kt +++ b/libraries/stdlib/src/generated/StandardFromJavaIterablesLazy.kt @@ -17,35 +17,35 @@ import java.util.List /** * Returns a list containing all elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filter + * @includeFunctionBody ../../test/CollectionTest.kt filter */ public inline fun Iterable.filter(predicate: (T) -> Boolean) : List = filterTo(ArrayList(), predicate) /** * Returns a list containing all elements which do not match the given predicate * - * @includeFunction ../../test/CollectionTest.kt filterNot + * @includeFunctionBody ../../test/CollectionTest.kt filterNot */ public inline fun Iterable.filterNot(predicate: (T)-> Boolean) : List = filterNotTo(ArrayList(), predicate) /** * Returns a list containing all the non-*null* elements * - * @includeFunction ../../test/CollectionTest.kt filterNotNull + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNull */ public inline fun Iterable?.filterNotNull() : List = filterNotNullTo>(java.util.ArrayList()) /** * Returns the result of transforming each element to one or more values which are concatenated together into a single collection * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun Iterable.flatMap(transform: (T)-> Collection) : Collection = flatMapTo(ArrayList(), transform) /** * Returns a list containing the first *n* elements * - * @includeFunction ../../test/CollectionTest.kt take + * @includeFunctionBody ../../test/CollectionTest.kt take */ public inline fun Iterable.take(n: Int): List { fun countTo(n: Int): (T) -> Boolean { @@ -58,14 +58,14 @@ public inline fun Iterable.take(n: Int): List { /** * Returns a list containing the first elements that satisfy the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt takeWhile + * @includeFunctionBody ../../test/CollectionTest.kt takeWhile */ public inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List = takeWhileTo(ArrayList(), predicate) /** * Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied * - * @includeFunction ../../test/CollectionTest.kt join + * @includeFunctionBody ../../test/CollectionTest.kt join */ public inline fun Iterable.join(separator: String = ", ", prefix: String = "", postfix: String = "") : String { val buffer = StringBuilder(prefix) diff --git a/libraries/stdlib/src/kotlin/Iterators.kt b/libraries/stdlib/src/kotlin/Iterators.kt index d286af1160d..37c824e2bc1 100644 --- a/libraries/stdlib/src/kotlin/Iterators.kt +++ b/libraries/stdlib/src/kotlin/Iterators.kt @@ -6,7 +6,7 @@ import kotlin.support.FunctionIterator /** * Returns an iterator which invokes the function to calculate the next value on each iteration until the function returns *null* * - * @includeFunction ../../test/iterators/IteratorsTest.kt fibonacci + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt fibonacci */ public inline fun iterate(nextFunction: () -> T?) : java.util.Iterator = FunctionIterator(nextFunction) @@ -29,7 +29,7 @@ private class FilterIsIterator(val iterator : java.util.Iterator, va /** * Returns an iterator over elements which match the given *predicate* * - * @includeFunction ../../test/iterators/IteratorsTest.kt filterAndTakeWhileExtractTheElementsWithinRange + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt filterAndTakeWhileExtractTheElementsWithinRange */ public inline fun java.util.Iterator.filter(predicate: (T) -> Boolean) : java.util.Iterator = FilterIterator(this, predicate) @@ -70,7 +70,7 @@ private class FilterNotNullIterator(val iterator : java.util.Iterator?) : /** * Returns an iterator obtained by applying *transform*, a function transforming an object of type *T* into an object of type *R* * - * @includeFunction ../../test/iterators/IteratorsTest.kt mapAndTakeWhileExtractTheTransformedElements + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt mapAndTakeWhileExtractTheTransformedElements */ public inline fun java.util.Iterator.map(transform: (T) -> R): java.util.Iterator = MapIterator(this, transform) @@ -87,7 +87,7 @@ private class MapIterator(val iterator : java.util.Iterator, val transf /** * Returns an iterator over the concatenated results of transforming each element to one or more values * - * @includeFunction ../../test/iterators/IteratorsTest.kt flatMapAndTakeExtractTheTransformedElements + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt flatMapAndTakeExtractTheTransformedElements */ public inline fun java.util.Iterator.flatMap(transform: (T) -> java.util.Iterator): java.util.Iterator = FlatMapIterator(this, transform) @@ -113,7 +113,7 @@ private class FlatMapIterator(val iterator : java.util.Iterator, val tr /** * Returns an iterator restricted to the first *n* elements * - * @includeFunction ../../test/iterators/IteratorsTest.kt takeExtractsTheFirstNElements + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt takeExtractsTheFirstNElements */ public inline fun java.util.Iterator.take(n: Int): java.util.Iterator { fun countTo(n: Int): (T) -> Boolean { @@ -126,7 +126,7 @@ public inline fun java.util.Iterator.take(n: Int): java.util.Iterator /** * Returns an iterator restricted to the first elements that match the given *predicate* * - * @includeFunction ../../test/iterators/IteratorsTest.kt filterAndTakeWhileExtractTheElementsWithinRange + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt filterAndTakeWhileExtractTheElementsWithinRange */ public inline fun java.util.Iterator.takeWhile(predicate: (T) -> Boolean): java.util.Iterator = TakeWhileIterator(this, predicate) @@ -146,7 +146,7 @@ private class TakeWhileIterator(val iterator: java.util.Iterator, val pred /** * Creates a string from the first *n (= limit)* elements separated using the *separator* and using the given *prefix* and *postfix* if supplied * - * @includeFunction ../../test/iterators/IteratorsTest.kt joinConcatenatesTheFirstNElementsAboveAThreshold + * @includeFunctionBody ../../test/iterators/IteratorsTest.kt joinConcatenatesTheFirstNElementsAboveAThreshold */ public inline fun java.util.Iterator.join(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int? = null) : String { val buffer = StringBuilder(prefix) diff --git a/libraries/stdlib/src/kotlin/JUMaps.kt b/libraries/stdlib/src/kotlin/JUMaps.kt index 7c755212b19..da6b1f9da11 100644 --- a/libraries/stdlib/src/kotlin/JUMaps.kt +++ b/libraries/stdlib/src/kotlin/JUMaps.kt @@ -38,7 +38,7 @@ public inline fun java.util.Map?.orEmpty() : java.util.Map /** * Returns the value for the given key or returns the result of the defaultValue function if there was no entry for the given key * - * @includeFunction ../../test/MapTest.kt getOrElse + * @includeFunctionBody ../../test/MapTest.kt getOrElse */ public inline fun java.util.Map.getOrElse(key: K, defaultValue: ()-> V) : V { val current = this.get(key) @@ -52,7 +52,7 @@ public inline fun java.util.Map.getOrElse(key: K, defaultValue: ()-> /** * Returns the value for the given key or the result of the defaultValue function is put into the map for the given value and returned * - * @includeFunction ../../test/MapTest.kt getOrElse + * @includeFunctionBody ../../test/MapTest.kt getOrElse */ public inline fun java.util.Map.getOrPut(key: K, defaultValue: ()-> V) : V { val current = this.get(key) diff --git a/libraries/stdlib/src/kotlin/JavaCollections.kt b/libraries/stdlib/src/kotlin/JavaCollections.kt index 69f4de8c163..6d8114b8d22 100644 --- a/libraries/stdlib/src/kotlin/JavaCollections.kt +++ b/libraries/stdlib/src/kotlin/JavaCollections.kt @@ -12,7 +12,7 @@ import java.util.* /** * Returns a new List containing the results of applying the given function to each element in this collection * - * @includeFunction ../../test/CollectionTest.kt map + * @includeFunctionBody ../../test/CollectionTest.kt map */ public inline fun java.util.Collection.map(transform : (T) -> R) : java.util.List { return mapTo(java.util.ArrayList(this.size), transform) diff --git a/libraries/stdlib/src/kotlin/JavaIterables.kt b/libraries/stdlib/src/kotlin/JavaIterables.kt index a561b38bcb2..d113cbd2bd4 100644 --- a/libraries/stdlib/src/kotlin/JavaIterables.kt +++ b/libraries/stdlib/src/kotlin/JavaIterables.kt @@ -5,7 +5,7 @@ import java.util.* /** * Returns *true* if any elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt any + * @includeFunctionBody ../../test/CollectionTest.kt any */ public inline fun java.lang.Iterable.any(predicate: (T) -> Boolean) : Boolean { for (element in this) if (predicate(element)) return true @@ -15,7 +15,7 @@ public inline fun java.lang.Iterable.any(predicate: (T) -> Boolean) : Boo /** * Returns *true* if all elements match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt all + * @includeFunctionBody ../../test/CollectionTest.kt all */ public inline fun java.lang.Iterable.all(predicate: (T) -> Boolean) : Boolean { for (element in this) if (!predicate(element)) return false @@ -25,7 +25,7 @@ public inline fun java.lang.Iterable.all(predicate: (T) -> Boolean) : Boo /** * Returns the number of elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt count + * @includeFunctionBody ../../test/CollectionTest.kt count */ public inline fun java.lang.Iterable.count(predicate: (T) -> Boolean) : Int { var count = 0 @@ -36,7 +36,7 @@ public inline fun java.lang.Iterable.count(predicate: (T) -> Boolean) : I /** * Returns the first element which matches the given *predicate* or *null* if none matched * - * @includeFunction ../../test/CollectionTest.kt find + * @includeFunctionBody ../../test/CollectionTest.kt find */ public inline fun java.lang.Iterable.find(predicate: (T) -> Boolean) : T? { for (element in this) if (predicate(element)) return element @@ -46,7 +46,7 @@ public inline fun java.lang.Iterable.find(predicate: (T) -> Boolean) : T? /** * Filters all elements which match the given predicate into the given list * - * @includeFunction ../../test/CollectionTest.kt filterIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList */ public inline fun > java.lang.Iterable.filterTo(result: C, predicate: (T) -> Boolean) : C { for (element in this) if (predicate(element)) result.add(element) @@ -56,7 +56,7 @@ public inline fun > java.lang.Iterable.filterTo(result /** * Returns a list containing all elements which do not match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filterNotIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList */ public inline fun > java.lang.Iterable.filterNotTo(result: L, predicate: (T) -> Boolean) : L { for (element in this) if (!predicate(element)) result.add(element) @@ -66,7 +66,7 @@ public inline fun > java.lang.Iterable.filterNotTo(result: L /** * Filters all non-*null* elements into the given list * - * @includeFunction ../../test/CollectionTest.kt filterNotNullIntoLinkedList + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList */ public inline fun > java.lang.Iterable?.filterNotNullTo(result: L) : L { if (this != null) { @@ -78,7 +78,7 @@ public inline fun > java.lang.Iterable?.filterNotNullTo(res /** * Returns the result of transforming each element to one or more values which are concatenated together into a single list * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun java.lang.Iterable.flatMapTo(result: Collection, transform: (T) -> Collection) : Collection { for (element in this) { @@ -93,14 +93,14 @@ public inline fun java.lang.Iterable.flatMapTo(result: Collection, /** * Performs the given *operation* on each element * - * @includeFunction ../../test/CollectionTest.kt forEach + * @includeFunctionBody ../../test/CollectionTest.kt forEach */ public inline fun java.lang.Iterable.forEach(operation: (T) -> Unit) : Unit = for (element in this) operation(element) /** * Folds all elements from from left to right with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt fold + * @includeFunctionBody ../../test/CollectionTest.kt fold */ public inline fun java.lang.Iterable.fold(initial: T, operation: (T, T) -> T): T { var answer = initial @@ -111,14 +111,14 @@ public inline fun java.lang.Iterable.fold(initial: T, operation: (T, T) - /** * Folds all elements from right to left with the *initial* value to perform the operation on sequential pairs of elements * - * @includeFunction ../../test/CollectionTest.kt foldRight + * @includeFunctionBody ../../test/CollectionTest.kt foldRight */ public inline fun java.lang.Iterable.foldRight(initial: T, operation: (T, T) -> T): T = reverse().fold(initial, operation) /** * Transforms each element using the result as the key in a map to group elements by the result * - * @includeFunction ../../test/CollectionTest.kt groupBy + * @includeFunctionBody ../../test/CollectionTest.kt groupBy */ public inline fun java.lang.Iterable.groupBy(result: Map> = HashMap>(), toKey: (T) -> K) : Map> { for (element in this) { @@ -138,7 +138,7 @@ public inline fun > java.lang.Iterable.takeWhileTo(result: L /** * Reverses the order the elements into a list * - * @includeFunction ../../test/CollectionTest.kt reverse + * @includeFunctionBody ../../test/CollectionTest.kt reverse */ public inline fun java.lang.Iterable.reverse() : List { val answer = LinkedList() diff --git a/libraries/stdlib/src/kotlin/JavaIterablesLazy.kt b/libraries/stdlib/src/kotlin/JavaIterablesLazy.kt index 9eba06d7e9e..2151c88ab51 100644 --- a/libraries/stdlib/src/kotlin/JavaIterablesLazy.kt +++ b/libraries/stdlib/src/kotlin/JavaIterablesLazy.kt @@ -14,35 +14,35 @@ import java.util.List /** * Returns a list containing all elements which match the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt filter + * @includeFunctionBody ../../test/CollectionTest.kt filter */ public inline fun java.lang.Iterable.filter(predicate: (T) -> Boolean) : List = filterTo(ArrayList(), predicate) /** * Returns a list containing all elements which do not match the given predicate * - * @includeFunction ../../test/CollectionTest.kt filterNot + * @includeFunctionBody ../../test/CollectionTest.kt filterNot */ public inline fun java.lang.Iterable.filterNot(predicate: (T)-> Boolean) : List = filterNotTo(ArrayList(), predicate) /** * Returns a list containing all the non-*null* elements * - * @includeFunction ../../test/CollectionTest.kt filterNotNull + * @includeFunctionBody ../../test/CollectionTest.kt filterNotNull */ public inline fun java.lang.Iterable?.filterNotNull() : List = filterNotNullTo>(java.util.ArrayList()) /** * Returns the result of transforming each element to one or more values which are concatenated together into a single collection * - * @includeFunction ../../test/CollectionTest.kt flatMap + * @includeFunctionBody ../../test/CollectionTest.kt flatMap */ public inline fun java.lang.Iterable.flatMap(transform: (T)-> Collection) : Collection = flatMapTo(ArrayList(), transform) /** * Returns a list containing the first *n* elements * - * @includeFunction ../../test/CollectionTest.kt take + * @includeFunctionBody ../../test/CollectionTest.kt take */ public inline fun java.lang.Iterable.take(n: Int): List { fun countTo(n: Int): (T) -> Boolean { @@ -55,14 +55,14 @@ public inline fun java.lang.Iterable.take(n: Int): List { /** * Returns a list containing the first elements that satisfy the given *predicate* * - * @includeFunction ../../test/CollectionTest.kt takeWhile + * @includeFunctionBody ../../test/CollectionTest.kt takeWhile */ public inline fun java.lang.Iterable.takeWhile(predicate: (T) -> Boolean): List = takeWhileTo(ArrayList(), predicate) /** * Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied * - * @includeFunction ../../test/CollectionTest.kt join + * @includeFunctionBody ../../test/CollectionTest.kt join */ public inline fun java.lang.Iterable.join(separator: String = ", ", prefix: String = "", postfix: String = "") : String { val buffer = StringBuilder(prefix) diff --git a/libraries/stdlib/src/kotlin/JavaIterablesSpecial.kt b/libraries/stdlib/src/kotlin/JavaIterablesSpecial.kt index 245e1551324..b50ac5cb50b 100644 --- a/libraries/stdlib/src/kotlin/JavaIterablesSpecial.kt +++ b/libraries/stdlib/src/kotlin/JavaIterablesSpecial.kt @@ -47,7 +47,7 @@ public inline fun java.lang.Iterable.first() : T { * * Will throw an exception if there are no elements. * - * @includeFunction ../../test/CollectionTest.kt last + * @includeFunctionBody ../../test/CollectionTest.kt last */ // TODO: Specify type of the exception public fun java.lang.Iterable.last() : T {