More standard library documentation.

This commit is contained in:
Dmitry Jemerov
2015-03-05 19:07:02 +01:00
parent cb27797845
commit 32072d0a4f
44 changed files with 1702 additions and 136 deletions
@@ -32,6 +32,11 @@ private fun generateDownTos(outputFile: File, header: String) {
}
writer.println("""
/**
* Returns a progression from this value down to the specified [to] value.
*
* The [to] value has to be less than this value.
*/
public fun $fromType.downTo(to: $toType): $progressionType {
return $progressionType($fromExpr, $toExpr, $incrementExpr)
}""")
@@ -277,7 +277,7 @@ fun elements(): List<GenericFunction> {
templates add f("first(predicate: (T) -> Boolean)") {
inline(true)
doc { """"Returns the first element matching the given [predicate].
doc { """Returns the first element matching the given [predicate].
@throws NoSuchElementException if no such element is found.""" }
doc(Strings) { """Returns the first character matching the given [predicate].
@throws NoSuchElementException if no such character is found.""" }
@@ -293,8 +293,8 @@ fun elements(): List<GenericFunction> {
templates add f("firstOrNull(predicate: (T) -> Boolean)") {
inline(true)
doc { "Returns first element matching the given [predicate], or `null` if element was not found" }
doc(Strings) { "Returns first character matching the given [predicate], or `null` if character was not found" }
doc { "Returns the first element matching the given [predicate], or `null` if element was not found" }
doc(Strings) { "Returns the first character matching the given [predicate], or `null` if character was not found" }
returns("T?")
body {
"""