Regenerate common stdlib: use 'expect' instead 'header'

This commit is contained in:
Stanislav Erokhin
2017-09-15 15:27:39 +03:00
parent e12de11ce9
commit 7cd5eeb24d
9 changed files with 1861 additions and 1861 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -15,218 +15,218 @@ import kotlin.comparisons.*
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public header fun <T: Comparable<T>> maxOf(a: T, b: T): T
public expect fun <T: Comparable<T>> maxOf(a: T, b: T): T
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Byte, b: Byte): Byte
public expect inline fun maxOf(a: Byte, b: Byte): Byte
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Short, b: Short): Short
public expect inline fun maxOf(a: Short, b: Short): Short
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Int, b: Int): Int
public expect inline fun maxOf(a: Int, b: Int): Int
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Long, b: Long): Long
public expect inline fun maxOf(a: Long, b: Long): Long
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Float, b: Float): Float
public expect inline fun maxOf(a: Float, b: Float): Float
/**
* Returns the greater of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Double, b: Double): Double
public expect inline fun maxOf(a: Double, b: Double): Double
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
public header fun <T: Comparable<T>> maxOf(a: T, b: T, c: T): T
public expect fun <T: Comparable<T>> maxOf(a: T, b: T, c: T): T
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
public expect inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Short, b: Short, c: Short): Short
public expect inline fun maxOf(a: Short, b: Short, c: Short): Short
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Int, b: Int, c: Int): Int
public expect inline fun maxOf(a: Int, b: Int, c: Int): Int
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Long, b: Long, c: Long): Long
public expect inline fun maxOf(a: Long, b: Long, c: Long): Long
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Float, b: Float, c: Float): Float
public expect inline fun maxOf(a: Float, b: Float, c: Float): Float
/**
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun maxOf(a: Double, b: Double, c: Double): Double
public expect inline fun maxOf(a: Double, b: Double, c: Double): Double
/**
* Returns the greater of three values according to the order specified by the given [comparator].
*/
@SinceKotlin("1.1")
public header fun <T> maxOf(a: T, b: T, c: T, comparator: Comparator<in T>): T
public expect fun <T> maxOf(a: T, b: T, c: T, comparator: Comparator<in T>): T
/**
* Returns the greater of two values according to the order specified by the given [comparator].
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public header fun <T> maxOf(a: T, b: T, comparator: Comparator<in T>): T
public expect fun <T> maxOf(a: T, b: T, comparator: Comparator<in T>): T
/**
* Returns the smaller of two values.
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public header fun <T: Comparable<T>> minOf(a: T, b: T): T
public expect fun <T: Comparable<T>> minOf(a: T, b: T): T
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Byte, b: Byte): Byte
public expect inline fun minOf(a: Byte, b: Byte): Byte
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Short, b: Short): Short
public expect inline fun minOf(a: Short, b: Short): Short
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Int, b: Int): Int
public expect inline fun minOf(a: Int, b: Int): Int
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Long, b: Long): Long
public expect inline fun minOf(a: Long, b: Long): Long
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Float, b: Float): Float
public expect inline fun minOf(a: Float, b: Float): Float
/**
* Returns the smaller of two values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Double, b: Double): Double
public expect inline fun minOf(a: Double, b: Double): Double
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
public header fun <T: Comparable<T>> minOf(a: T, b: T, c: T): T
public expect fun <T: Comparable<T>> minOf(a: T, b: T, c: T): T
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Byte, b: Byte, c: Byte): Byte
public expect inline fun minOf(a: Byte, b: Byte, c: Byte): Byte
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Short, b: Short, c: Short): Short
public expect inline fun minOf(a: Short, b: Short, c: Short): Short
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Int, b: Int, c: Int): Int
public expect inline fun minOf(a: Int, b: Int, c: Int): Int
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Long, b: Long, c: Long): Long
public expect inline fun minOf(a: Long, b: Long, c: Long): Long
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Float, b: Float, c: Float): Float
public expect inline fun minOf(a: Float, b: Float, c: Float): Float
/**
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
@kotlin.internal.InlineOnly
public header inline fun minOf(a: Double, b: Double, c: Double): Double
public expect inline fun minOf(a: Double, b: Double, c: Double): Double
/**
* Returns the smaller of three values according to the order specified by the given [comparator].
*/
@SinceKotlin("1.1")
public header fun <T> minOf(a: T, b: T, c: T, comparator: Comparator<in T>): T
public expect fun <T> minOf(a: T, b: T, c: T, comparator: Comparator<in T>): T
/**
* Returns the smaller of two values according to the order specified by the given [comparator].
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public header fun <T> minOf(a: T, b: T, comparator: Comparator<in T>): T
public expect fun <T> minOf(a: T, b: T, comparator: Comparator<in T>): T
+22 -22
View File
@@ -13,120 +13,120 @@ import kotlin.comparisons.*
/**
* Returns a [List] containing all key-value pairs.
*/
public header fun <K, V> Map<out K, V>.toList(): List<Pair<K, V>>
public expect fun <K, V> Map<out K, V>.toList(): List<Pair<K, V>>
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each entry of original map.
*/
public header inline fun <K, V, R> Map<out K, V>.flatMap(transform: (Map.Entry<K, V>) -> Iterable<R>): List<R>
public expect inline fun <K, V, R> Map<out K, V>.flatMap(transform: (Map.Entry<K, V>) -> Iterable<R>): List<R>
/**
* Appends all elements yielded from results of [transform] function being invoked on each entry of original map, to the given [destination].
*/
public header inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(destination: C, transform: (Map.Entry<K, V>) -> Iterable<R>): C
public expect inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(destination: C, transform: (Map.Entry<K, V>) -> Iterable<R>): C
/**
* Returns a list containing the results of applying the given [transform] function
* to each entry in the original map.
*/
public header inline fun <K, V, R> Map<out K, V>.map(transform: (Map.Entry<K, V>) -> R): List<R>
public expect inline fun <K, V, R> Map<out K, V>.map(transform: (Map.Entry<K, V>) -> R): List<R>
/**
* Returns a list containing only the non-null results of applying the given [transform] function
* to each entry in the original map.
*/
public header inline fun <K, V, R : Any> Map<out K, V>.mapNotNull(transform: (Map.Entry<K, V>) -> R?): List<R>
public expect inline fun <K, V, R : Any> Map<out K, V>.mapNotNull(transform: (Map.Entry<K, V>) -> R?): List<R>
/**
* Applies the given [transform] function to each entry in the original map
* and appends only the non-null results to the given [destination].
*/
public header inline fun <K, V, R : Any, C : MutableCollection<in R>> Map<out K, V>.mapNotNullTo(destination: C, transform: (Map.Entry<K, V>) -> R?): C
public expect inline fun <K, V, R : Any, C : MutableCollection<in R>> Map<out K, V>.mapNotNullTo(destination: C, transform: (Map.Entry<K, V>) -> R?): C
/**
* Applies the given [transform] function to each entry of the original map
* and appends the results to the given [destination].
*/
public header inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.mapTo(destination: C, transform: (Map.Entry<K, V>) -> R): C
public expect inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.mapTo(destination: C, transform: (Map.Entry<K, V>) -> R): C
/**
* Returns `true` if all entries match the given [predicate].
*/
public header inline fun <K, V> Map<out K, V>.all(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
public expect inline fun <K, V> Map<out K, V>.all(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
/**
* Returns `true` if map has at least one entry.
*/
public header fun <K, V> Map<out K, V>.any(): Boolean
public expect fun <K, V> Map<out K, V>.any(): Boolean
/**
* Returns `true` if at least one entry matches the given [predicate].
*/
public header inline fun <K, V> Map<out K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
public expect inline fun <K, V> Map<out K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
/**
* Returns the number of entries in this map.
*/
@kotlin.internal.InlineOnly
public header inline fun <K, V> Map<out K, V>.count(): Int
public expect inline fun <K, V> Map<out K, V>.count(): Int
/**
* Returns the number of entries matching the given [predicate].
*/
public header inline fun <K, V> Map<out K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean): Int
public expect inline fun <K, V> Map<out K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean): Int
/**
* Performs the given [action] on each entry.
*/
@kotlin.internal.HidesMembers
public header inline fun <K, V> Map<out K, V>.forEach(action: (Map.Entry<K, V>) -> Unit): Unit
public expect inline fun <K, V> Map<out K, V>.forEach(action: (Map.Entry<K, V>) -> Unit): Unit
/**
* Returns the first entry yielding the largest value of the given function or `null` if there are no entries.
*/
@kotlin.internal.InlineOnly
public header inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
public expect inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
/**
* Returns the first entry having the largest value according to the provided [comparator] or `null` if there are no entries.
*/
@kotlin.internal.InlineOnly
public header inline fun <K, V> Map<out K, V>.maxWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
public expect inline fun <K, V> Map<out K, V>.maxWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
/**
* Returns the first entry yielding the smallest value of the given function or `null` if there are no entries.
*/
public header inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
public expect inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(selector: (Map.Entry<K, V>) -> R): Map.Entry<K, V>?
/**
* Returns the first entry having the smallest value according to the provided [comparator] or `null` if there are no entries.
*/
public header fun <K, V> Map<out K, V>.minWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
public expect fun <K, V> Map<out K, V>.minWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?
/**
* Returns `true` if the map has no entries.
*/
public header fun <K, V> Map<out K, V>.none(): Boolean
public expect fun <K, V> Map<out K, V>.none(): Boolean
/**
* Returns `true` if no entries match the given [predicate].
*/
public header inline fun <K, V> Map<out K, V>.none(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
public expect inline fun <K, V> Map<out K, V>.none(predicate: (Map.Entry<K, V>) -> Boolean): Boolean
/**
* Performs the given [action] on each entry and returns the map itself afterwards.
*/
@SinceKotlin("1.1")
public header inline fun <K, V, M : Map<out K, V>> M.onEach(action: (Map.Entry<K, V>) -> Unit): M
public expect inline fun <K, V, M : Map<out K, V>> M.onEach(action: (Map.Entry<K, V>) -> Unit): M
/**
* Creates an [Iterable] instance that wraps the original map returning its entries when being iterated.
*/
@kotlin.internal.InlineOnly
public header inline fun <K, V> Map<out K, V>.asIterable(): Iterable<Map.Entry<K, V>>
public expect inline fun <K, V> Map<out K, V>.asIterable(): Iterable<Map.Entry<K, V>>
/**
* Creates a [Sequence] instance that wraps the original map returning its entries when being iterated.
*/
public header fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>>
public expect fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>>
+109 -109
View File
@@ -14,606 +14,606 @@ import kotlin.comparisons.*
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("intRangeContains")
public header operator fun ClosedRange<Int>.contains(value: Byte): Boolean
public expect operator fun ClosedRange<Int>.contains(value: Byte): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("longRangeContains")
public header operator fun ClosedRange<Long>.contains(value: Byte): Boolean
public expect operator fun ClosedRange<Long>.contains(value: Byte): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("shortRangeContains")
public header operator fun ClosedRange<Short>.contains(value: Byte): Boolean
public expect operator fun ClosedRange<Short>.contains(value: Byte): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("doubleRangeContains")
public header operator fun ClosedRange<Double>.contains(value: Byte): Boolean
public expect operator fun ClosedRange<Double>.contains(value: Byte): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("floatRangeContains")
public header operator fun ClosedRange<Float>.contains(value: Byte): Boolean
public expect operator fun ClosedRange<Float>.contains(value: Byte): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("intRangeContains")
public header operator fun ClosedRange<Int>.contains(value: Double): Boolean
public expect operator fun ClosedRange<Int>.contains(value: Double): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("longRangeContains")
public header operator fun ClosedRange<Long>.contains(value: Double): Boolean
public expect operator fun ClosedRange<Long>.contains(value: Double): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("byteRangeContains")
public header operator fun ClosedRange<Byte>.contains(value: Double): Boolean
public expect operator fun ClosedRange<Byte>.contains(value: Double): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("shortRangeContains")
public header operator fun ClosedRange<Short>.contains(value: Double): Boolean
public expect operator fun ClosedRange<Short>.contains(value: Double): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("floatRangeContains")
public header operator fun ClosedRange<Float>.contains(value: Double): Boolean
public expect operator fun ClosedRange<Float>.contains(value: Double): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("intRangeContains")
public header operator fun ClosedRange<Int>.contains(value: Float): Boolean
public expect operator fun ClosedRange<Int>.contains(value: Float): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("longRangeContains")
public header operator fun ClosedRange<Long>.contains(value: Float): Boolean
public expect operator fun ClosedRange<Long>.contains(value: Float): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("byteRangeContains")
public header operator fun ClosedRange<Byte>.contains(value: Float): Boolean
public expect operator fun ClosedRange<Byte>.contains(value: Float): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("shortRangeContains")
public header operator fun ClosedRange<Short>.contains(value: Float): Boolean
public expect operator fun ClosedRange<Short>.contains(value: Float): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("doubleRangeContains")
public header operator fun ClosedRange<Double>.contains(value: Float): Boolean
public expect operator fun ClosedRange<Double>.contains(value: Float): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("longRangeContains")
public header operator fun ClosedRange<Long>.contains(value: Int): Boolean
public expect operator fun ClosedRange<Long>.contains(value: Int): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("byteRangeContains")
public header operator fun ClosedRange<Byte>.contains(value: Int): Boolean
public expect operator fun ClosedRange<Byte>.contains(value: Int): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("shortRangeContains")
public header operator fun ClosedRange<Short>.contains(value: Int): Boolean
public expect operator fun ClosedRange<Short>.contains(value: Int): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("doubleRangeContains")
public header operator fun ClosedRange<Double>.contains(value: Int): Boolean
public expect operator fun ClosedRange<Double>.contains(value: Int): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("floatRangeContains")
public header operator fun ClosedRange<Float>.contains(value: Int): Boolean
public expect operator fun ClosedRange<Float>.contains(value: Int): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("intRangeContains")
public header operator fun ClosedRange<Int>.contains(value: Long): Boolean
public expect operator fun ClosedRange<Int>.contains(value: Long): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("byteRangeContains")
public header operator fun ClosedRange<Byte>.contains(value: Long): Boolean
public expect operator fun ClosedRange<Byte>.contains(value: Long): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("shortRangeContains")
public header operator fun ClosedRange<Short>.contains(value: Long): Boolean
public expect operator fun ClosedRange<Short>.contains(value: Long): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("doubleRangeContains")
public header operator fun ClosedRange<Double>.contains(value: Long): Boolean
public expect operator fun ClosedRange<Double>.contains(value: Long): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("floatRangeContains")
public header operator fun ClosedRange<Float>.contains(value: Long): Boolean
public expect operator fun ClosedRange<Float>.contains(value: Long): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("intRangeContains")
public header operator fun ClosedRange<Int>.contains(value: Short): Boolean
public expect operator fun ClosedRange<Int>.contains(value: Short): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("longRangeContains")
public header operator fun ClosedRange<Long>.contains(value: Short): Boolean
public expect operator fun ClosedRange<Long>.contains(value: Short): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("byteRangeContains")
public header operator fun ClosedRange<Byte>.contains(value: Short): Boolean
public expect operator fun ClosedRange<Byte>.contains(value: Short): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("doubleRangeContains")
public header operator fun ClosedRange<Double>.contains(value: Short): Boolean
public expect operator fun ClosedRange<Double>.contains(value: Short): Boolean
/**
* Checks if the specified [value] belongs to this range.
*/
@kotlin.jvm.JvmName("floatRangeContains")
public header operator fun ClosedRange<Float>.contains(value: Short): Boolean
public expect operator fun ClosedRange<Float>.contains(value: Short): Boolean
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Int.downTo(to: Byte): IntProgression
public expect infix fun Int.downTo(to: Byte): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Long.downTo(to: Byte): LongProgression
public expect infix fun Long.downTo(to: Byte): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Byte.downTo(to: Byte): IntProgression
public expect infix fun Byte.downTo(to: Byte): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Short.downTo(to: Byte): IntProgression
public expect infix fun Short.downTo(to: Byte): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Char.downTo(to: Char): CharProgression
public expect infix fun Char.downTo(to: Char): CharProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Int.downTo(to: Int): IntProgression
public expect infix fun Int.downTo(to: Int): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Long.downTo(to: Int): LongProgression
public expect infix fun Long.downTo(to: Int): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Byte.downTo(to: Int): IntProgression
public expect infix fun Byte.downTo(to: Int): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Short.downTo(to: Int): IntProgression
public expect infix fun Short.downTo(to: Int): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Int.downTo(to: Long): LongProgression
public expect infix fun Int.downTo(to: Long): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Long.downTo(to: Long): LongProgression
public expect infix fun Long.downTo(to: Long): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Byte.downTo(to: Long): LongProgression
public expect infix fun Byte.downTo(to: Long): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Short.downTo(to: Long): LongProgression
public expect infix fun Short.downTo(to: Long): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Int.downTo(to: Short): IntProgression
public expect infix fun Int.downTo(to: Short): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Long.downTo(to: Short): LongProgression
public expect infix fun Long.downTo(to: Short): LongProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Byte.downTo(to: Short): IntProgression
public expect infix fun Byte.downTo(to: Short): IntProgression
/**
* Returns a progression from this value down to the specified [to] value with the step -1.
*
* The [to] value has to be less than this value.
*/
public header infix fun Short.downTo(to: Short): IntProgression
public expect infix fun Short.downTo(to: Short): IntProgression
/**
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public header fun IntProgression.reversed(): IntProgression
public expect fun IntProgression.reversed(): IntProgression
/**
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public header fun LongProgression.reversed(): LongProgression
public expect fun LongProgression.reversed(): LongProgression
/**
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public header fun CharProgression.reversed(): CharProgression
public expect fun CharProgression.reversed(): CharProgression
/**
* Returns a progression that goes over the same range with the given step.
*/
public header infix fun IntProgression.step(step: Int): IntProgression
public expect infix fun IntProgression.step(step: Int): IntProgression
/**
* Returns a progression that goes over the same range with the given step.
*/
public header infix fun LongProgression.step(step: Long): LongProgression
public expect infix fun LongProgression.step(step: Long): LongProgression
/**
* Returns a progression that goes over the same range with the given step.
*/
public header infix fun CharProgression.step(step: Int): CharProgression
public expect infix fun CharProgression.step(step: Int): CharProgression
internal header fun Int.toByteExactOrNull(): Byte?
internal expect fun Int.toByteExactOrNull(): Byte?
internal header fun Long.toByteExactOrNull(): Byte?
internal expect fun Long.toByteExactOrNull(): Byte?
internal header fun Short.toByteExactOrNull(): Byte?
internal expect fun Short.toByteExactOrNull(): Byte?
internal header fun Double.toByteExactOrNull(): Byte?
internal expect fun Double.toByteExactOrNull(): Byte?
internal header fun Float.toByteExactOrNull(): Byte?
internal expect fun Float.toByteExactOrNull(): Byte?
internal header fun Long.toIntExactOrNull(): Int?
internal expect fun Long.toIntExactOrNull(): Int?
internal header fun Double.toIntExactOrNull(): Int?
internal expect fun Double.toIntExactOrNull(): Int?
internal header fun Float.toIntExactOrNull(): Int?
internal expect fun Float.toIntExactOrNull(): Int?
internal header fun Double.toLongExactOrNull(): Long?
internal expect fun Double.toLongExactOrNull(): Long?
internal header fun Float.toLongExactOrNull(): Long?
internal expect fun Float.toLongExactOrNull(): Long?
internal header fun Int.toShortExactOrNull(): Short?
internal expect fun Int.toShortExactOrNull(): Short?
internal header fun Long.toShortExactOrNull(): Short?
internal expect fun Long.toShortExactOrNull(): Short?
internal header fun Double.toShortExactOrNull(): Short?
internal expect fun Double.toShortExactOrNull(): Short?
internal header fun Float.toShortExactOrNull(): Short?
internal expect fun Float.toShortExactOrNull(): Short?
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Int.until(to: Byte): IntRange
public expect infix fun Int.until(to: Byte): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Long.until(to: Byte): LongRange
public expect infix fun Long.until(to: Byte): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Byte.until(to: Byte): IntRange
public expect infix fun Byte.until(to: Byte): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Short.until(to: Byte): IntRange
public expect infix fun Short.until(to: Byte): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to ['\u0000'] the returned range is empty.
*/
public header infix fun Char.until(to: Char): CharRange
public expect infix fun Char.until(to: Char): CharRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty.
*/
public header infix fun Int.until(to: Int): IntRange
public expect infix fun Int.until(to: Int): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Long.until(to: Int): LongRange
public expect infix fun Long.until(to: Int): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty.
*/
public header infix fun Byte.until(to: Int): IntRange
public expect infix fun Byte.until(to: Int): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty.
*/
public header infix fun Short.until(to: Int): IntRange
public expect infix fun Short.until(to: Int): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty.
*/
public header infix fun Int.until(to: Long): LongRange
public expect infix fun Int.until(to: Long): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty.
*/
public header infix fun Long.until(to: Long): LongRange
public expect infix fun Long.until(to: Long): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty.
*/
public header infix fun Byte.until(to: Long): LongRange
public expect infix fun Byte.until(to: Long): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*
* If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty.
*/
public header infix fun Short.until(to: Long): LongRange
public expect infix fun Short.until(to: Long): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Int.until(to: Short): IntRange
public expect infix fun Int.until(to: Short): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Long.until(to: Short): LongRange
public expect infix fun Long.until(to: Short): LongRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Byte.until(to: Short): IntRange
public expect infix fun Byte.until(to: Short): IntRange
/**
* Returns a range from this value up to but excluding the specified [to] value.
*/
public header infix fun Short.until(to: Short): IntRange
public expect infix fun Short.until(to: Short): IntRange
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun <T: Comparable<T>> T.coerceAtLeast(minimumValue: T): T
public expect fun <T: Comparable<T>> T.coerceAtLeast(minimumValue: T): T
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Byte.coerceAtLeast(minimumValue: Byte): Byte
public expect fun Byte.coerceAtLeast(minimumValue: Byte): Byte
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Short.coerceAtLeast(minimumValue: Short): Short
public expect fun Short.coerceAtLeast(minimumValue: Short): Short
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Int.coerceAtLeast(minimumValue: Int): Int
public expect fun Int.coerceAtLeast(minimumValue: Int): Int
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Long.coerceAtLeast(minimumValue: Long): Long
public expect fun Long.coerceAtLeast(minimumValue: Long): Long
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Float.coerceAtLeast(minimumValue: Float): Float
public expect fun Float.coerceAtLeast(minimumValue: Float): Float
/**
* Ensures that this value is not less than the specified [minimumValue].
*
* @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.
*/
public header fun Double.coerceAtLeast(minimumValue: Double): Double
public expect fun Double.coerceAtLeast(minimumValue: Double): Double
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun <T: Comparable<T>> T.coerceAtMost(maximumValue: T): T
public expect fun <T: Comparable<T>> T.coerceAtMost(maximumValue: T): T
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Byte.coerceAtMost(maximumValue: Byte): Byte
public expect fun Byte.coerceAtMost(maximumValue: Byte): Byte
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Short.coerceAtMost(maximumValue: Short): Short
public expect fun Short.coerceAtMost(maximumValue: Short): Short
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Int.coerceAtMost(maximumValue: Int): Int
public expect fun Int.coerceAtMost(maximumValue: Int): Int
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Long.coerceAtMost(maximumValue: Long): Long
public expect fun Long.coerceAtMost(maximumValue: Long): Long
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Float.coerceAtMost(maximumValue: Float): Float
public expect fun Float.coerceAtMost(maximumValue: Float): Float
/**
* Ensures that this value is not greater than the specified [maximumValue].
*
* @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.
*/
public header fun Double.coerceAtMost(maximumValue: Double): Double
public expect fun Double.coerceAtMost(maximumValue: Double): Double
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun <T: Comparable<T>> T.coerceIn(minimumValue: T?, maximumValue: T?): T
public expect fun <T: Comparable<T>> T.coerceIn(minimumValue: T?, maximumValue: T?): T
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte
public expect fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short
public expect fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int
public expect fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long
public expect fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float
public expect fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float
/**
* Ensures that this value lies in the specified range [minimumValue]..[maximumValue].
*
* @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].
*/
public header fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double
public expect fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double
/**
* Ensures that this value lies in the specified [range].
@@ -621,26 +621,26 @@ public header fun Double.coerceIn(minimumValue: Double, maximumValue: Double): D
* @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.
*/
@SinceKotlin("1.1")
public header fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T
public expect fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T
/**
* Ensures that this value lies in the specified [range].
*
* @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.
*/
public header fun <T: Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
public expect fun <T: Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
/**
* Ensures that this value lies in the specified [range].
*
* @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.
*/
public header fun Int.coerceIn(range: ClosedRange<Int>): Int
public expect fun Int.coerceIn(range: ClosedRange<Int>): Int
/**
* Ensures that this value lies in the specified [range].
*
* @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.
*/
public header fun Long.coerceIn(range: ClosedRange<Long>): Long
public expect fun Long.coerceIn(range: ClosedRange<Long>): Long
@@ -15,28 +15,28 @@ import kotlin.comparisons.*
*
* The operation is _terminal_.
*/
public header operator fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.contains(element: T): Boolean
public expect operator fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.contains(element: T): Boolean
/**
* Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this sequence.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.elementAt(index: Int): T
public expect fun <T> Sequence<T>.elementAt(index: Int): T
/**
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this sequence.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T
public expect fun <T> Sequence<T>.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T
/**
* Returns an element at the given [index] or `null` if the [index] is out of bounds of this sequence.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.elementAtOrNull(index: Int): T?
public expect fun <T> Sequence<T>.elementAtOrNull(index: Int): T?
/**
* Returns the first element matching the given [predicate], or `null` if no such element was found.
@@ -44,7 +44,7 @@ public header fun <T> Sequence<T>.elementAtOrNull(index: Int): T?
* The operation is _terminal_.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Sequence<T>.find(predicate: (T) -> Boolean): T?
public expect inline fun <T> Sequence<T>.find(predicate: (T) -> Boolean): T?
/**
* Returns the last element matching the given [predicate], or `null` if no such element was found.
@@ -52,7 +52,7 @@ public header inline fun <T> Sequence<T>.find(predicate: (T) -> Boolean): T?
* The operation is _terminal_.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Sequence<T>.findLast(predicate: (T) -> Boolean): T?
public expect inline fun <T> Sequence<T>.findLast(predicate: (T) -> Boolean): T?
/**
* Returns first element.
@@ -60,7 +60,7 @@ public header inline fun <T> Sequence<T>.findLast(predicate: (T) -> Boolean): T?
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.first(): T
public expect fun <T> Sequence<T>.first(): T
/**
* Returns the first element matching the given [predicate].
@@ -68,42 +68,42 @@ public header fun <T> Sequence<T>.first(): T
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.first(predicate: (T) -> Boolean): T
public expect inline fun <T> Sequence<T>.first(predicate: (T) -> Boolean): T
/**
* Returns the first element, or `null` if the sequence is empty.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.firstOrNull(): T?
public expect fun <T> Sequence<T>.firstOrNull(): T?
/**
* Returns the first element matching the given [predicate], or `null` if element was not found.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.firstOrNull(predicate: (T) -> Boolean): T?
public expect inline fun <T> Sequence<T>.firstOrNull(predicate: (T) -> Boolean): T?
/**
* Returns first index of [element], or -1 if the sequence does not contain element.
*
* The operation is _terminal_.
*/
public header fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.indexOf(element: T): Int
public expect fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.indexOf(element: T): Int
/**
* Returns index of the first element matching the given [predicate], or -1 if the sequence does not contain such element.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.indexOfFirst(predicate: (T) -> Boolean): Int
public expect inline fun <T> Sequence<T>.indexOfFirst(predicate: (T) -> Boolean): Int
/**
* Returns index of the last element matching the given [predicate], or -1 if the sequence does not contain such element.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.indexOfLast(predicate: (T) -> Boolean): Int
public expect inline fun <T> Sequence<T>.indexOfLast(predicate: (T) -> Boolean): Int
/**
* Returns the last element.
@@ -111,7 +111,7 @@ public header inline fun <T> Sequence<T>.indexOfLast(predicate: (T) -> Boolean):
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.last(): T
public expect fun <T> Sequence<T>.last(): T
/**
* Returns the last element matching the given [predicate].
@@ -119,77 +119,77 @@ public header fun <T> Sequence<T>.last(): T
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.last(predicate: (T) -> Boolean): T
public expect inline fun <T> Sequence<T>.last(predicate: (T) -> Boolean): T
/**
* Returns last index of [element], or -1 if the sequence does not contain element.
*
* The operation is _terminal_.
*/
public header fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.lastIndexOf(element: T): Int
public expect fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.lastIndexOf(element: T): Int
/**
* Returns the last element, or `null` if the sequence is empty.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.lastOrNull(): T?
public expect fun <T> Sequence<T>.lastOrNull(): T?
/**
* Returns the last element matching the given [predicate], or `null` if no such element was found.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.lastOrNull(predicate: (T) -> Boolean): T?
public expect inline fun <T> Sequence<T>.lastOrNull(predicate: (T) -> Boolean): T?
/**
* Returns the single element, or throws an exception if the sequence is empty or has more than one element.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.single(): T
public expect fun <T> Sequence<T>.single(): T
/**
* Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.single(predicate: (T) -> Boolean): T
public expect inline fun <T> Sequence<T>.single(predicate: (T) -> Boolean): T
/**
* Returns single element, or `null` if the sequence is empty or has more than one element.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.singleOrNull(): T?
public expect fun <T> Sequence<T>.singleOrNull(): T?
/**
* Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.singleOrNull(predicate: (T) -> Boolean): T?
public expect inline fun <T> Sequence<T>.singleOrNull(predicate: (T) -> Boolean): T?
/**
* Returns a sequence containing all elements except first [n] elements.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.drop(n: Int): Sequence<T>
public expect fun <T> Sequence<T>.drop(n: Int): Sequence<T>
/**
* Returns a sequence containing all elements except first elements that satisfy the given [predicate].
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.dropWhile(predicate: (T) -> Boolean): Sequence<T>
public expect fun <T> Sequence<T>.dropWhile(predicate: (T) -> Boolean): Sequence<T>
/**
* Returns a sequence containing only elements matching the given [predicate].
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.filter(predicate: (T) -> Boolean): Sequence<T>
public expect fun <T> Sequence<T>.filter(predicate: (T) -> Boolean): Sequence<T>
/**
* Returns a sequence containing only elements matching the given [predicate].
@@ -198,7 +198,7 @@ public header fun <T> Sequence<T>.filter(predicate: (T) -> Boolean): Sequence<T>
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.filterIndexed(predicate: (index: Int, T) -> Boolean): Sequence<T>
public expect fun <T> Sequence<T>.filterIndexed(predicate: (index: Int, T) -> Boolean): Sequence<T>
/**
* Appends all elements matching the given [predicate] to the given [destination].
@@ -207,105 +207,105 @@ public header fun <T> Sequence<T>.filterIndexed(predicate: (index: Int, T) -> Bo
*
* The operation is _terminal_.
*/
public header inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C
public expect inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C
/**
* Returns a sequence containing all elements that are instances of specified type parameter R.
*
* The operation is _intermediate_ and _stateless_.
*/
public header inline fun <reified R> Sequence<*>.filterIsInstance(): Sequence<@kotlin.internal.NoInfer R>
public expect inline fun <reified R> Sequence<*>.filterIsInstance(): Sequence<@kotlin.internal.NoInfer R>
/**
* Appends all elements that are instances of specified type parameter R to the given [destination].
*
* The operation is _terminal_.
*/
public header inline fun <reified R, C : MutableCollection<in R>> Sequence<*>.filterIsInstanceTo(destination: C): C
public expect inline fun <reified R, C : MutableCollection<in R>> Sequence<*>.filterIsInstanceTo(destination: C): C
/**
* Returns a sequence containing all elements not matching the given [predicate].
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.filterNot(predicate: (T) -> Boolean): Sequence<T>
public expect fun <T> Sequence<T>.filterNot(predicate: (T) -> Boolean): Sequence<T>
/**
* Returns a sequence containing all elements that are not `null`.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T : Any> Sequence<T?>.filterNotNull(): Sequence<T>
public expect fun <T : Any> Sequence<T?>.filterNotNull(): Sequence<T>
/**
* Appends all elements that are not `null` to the given [destination].
*
* The operation is _terminal_.
*/
public header fun <C : MutableCollection<in T>, T : Any> Sequence<T?>.filterNotNullTo(destination: C): C
public expect fun <C : MutableCollection<in T>, T : Any> Sequence<T?>.filterNotNullTo(destination: C): C
/**
* Appends all elements not matching the given [predicate] to the given [destination].
*
* The operation is _terminal_.
*/
public header inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C
public expect inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C
/**
* Appends all elements matching the given [predicate] to the given [destination].
*
* The operation is _terminal_.
*/
public header inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterTo(destination: C, predicate: (T) -> Boolean): C
public expect inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterTo(destination: C, predicate: (T) -> Boolean): C
/**
* Returns a sequence containing first [n] elements.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.take(n: Int): Sequence<T>
public expect fun <T> Sequence<T>.take(n: Int): Sequence<T>
/**
* Returns a sequence containing first elements satisfying the given [predicate].
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.takeWhile(predicate: (T) -> Boolean): Sequence<T>
public expect fun <T> Sequence<T>.takeWhile(predicate: (T) -> Boolean): Sequence<T>
/**
* Returns a sequence that yields elements of this sequence sorted according to their natural sort order.
*
* The operation is _intermediate_ and _stateful_.
*/
public header fun <T : Comparable<T>> Sequence<T>.sorted(): Sequence<T>
public expect fun <T : Comparable<T>> Sequence<T>.sorted(): Sequence<T>
/**
* Returns a sequence that yields elements of this sequence sorted according to natural sort order of the value returned by specified [selector] function.
*
* The operation is _intermediate_ and _stateful_.
*/
public header inline fun <T, R : Comparable<R>> Sequence<T>.sortedBy(crossinline selector: (T) -> R?): Sequence<T>
public expect inline fun <T, R : Comparable<R>> Sequence<T>.sortedBy(crossinline selector: (T) -> R?): Sequence<T>
/**
* Returns a sequence that yields elements of this sequence sorted descending according to natural sort order of the value returned by specified [selector] function.
*
* The operation is _intermediate_ and _stateful_.
*/
public header inline fun <T, R : Comparable<R>> Sequence<T>.sortedByDescending(crossinline selector: (T) -> R?): Sequence<T>
public expect inline fun <T, R : Comparable<R>> Sequence<T>.sortedByDescending(crossinline selector: (T) -> R?): Sequence<T>
/**
* Returns a sequence that yields elements of this sequence sorted descending according to their natural sort order.
*
* The operation is _intermediate_ and _stateful_.
*/
public header fun <T : Comparable<T>> Sequence<T>.sortedDescending(): Sequence<T>
public expect fun <T : Comparable<T>> Sequence<T>.sortedDescending(): Sequence<T>
/**
* Returns a sequence that yields elements of this sequence sorted according to the specified [comparator].
*
* The operation is _intermediate_ and _stateful_.
*/
public header fun <T> Sequence<T>.sortedWith(comparator: Comparator<in T>): Sequence<T>
public expect fun <T> Sequence<T>.sortedWith(comparator: Comparator<in T>): Sequence<T>
/**
* Returns a [Map] containing key-value pairs provided by [transform] function
@@ -317,7 +317,7 @@ public header fun <T> Sequence<T>.sortedWith(comparator: Comparator<in T>): Sequ
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V> Sequence<T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
public expect inline fun <T, K, V> Sequence<T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
/**
* Returns a [Map] containing the elements from the given sequence indexed by the key
@@ -329,7 +329,7 @@ public header inline fun <T, K, V> Sequence<T>.associate(transform: (T) -> Pair<
*
* The operation is _terminal_.
*/
public header inline fun <T, K> Sequence<T>.associateBy(keySelector: (T) -> K): Map<K, T>
public expect inline fun <T, K> Sequence<T>.associateBy(keySelector: (T) -> K): Map<K, T>
/**
* Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given sequence.
@@ -340,7 +340,7 @@ public header inline fun <T, K> Sequence<T>.associateBy(keySelector: (T) -> K):
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V> Sequence<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>
public expect inline fun <T, K, V> Sequence<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>
/**
* Populates and returns the [destination] mutable map with key-value pairs,
@@ -351,7 +351,7 @@ public header inline fun <T, K, V> Sequence<T>.associateBy(keySelector: (T) -> K
*
* The operation is _terminal_.
*/
public header inline fun <T, K, M : MutableMap<in K, in T>> Sequence<T>.associateByTo(destination: M, keySelector: (T) -> K): M
public expect inline fun <T, K, M : MutableMap<in K, in T>> Sequence<T>.associateByTo(destination: M, keySelector: (T) -> K): M
/**
* Populates and returns the [destination] mutable map with key-value pairs,
@@ -362,7 +362,7 @@ public header inline fun <T, K, M : MutableMap<in K, in T>> Sequence<T>.associat
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V, M : MutableMap<in K, in V>> Sequence<T>.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
public expect inline fun <T, K, V, M : MutableMap<in K, in V>> Sequence<T>.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
/**
* Populates and returns the [destination] mutable map with key-value pairs
@@ -372,35 +372,35 @@ public header inline fun <T, K, V, M : MutableMap<in K, in V>> Sequence<T>.assoc
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V, M : MutableMap<in K, in V>> Sequence<T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M
public expect inline fun <T, K, V, M : MutableMap<in K, in V>> Sequence<T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M
/**
* Appends all elements to the given [destination] collection.
*
* The operation is _terminal_.
*/
public header fun <T, C : MutableCollection<in T>> Sequence<T>.toCollection(destination: C): C
public expect fun <T, C : MutableCollection<in T>> Sequence<T>.toCollection(destination: C): C
/**
* Returns a [HashSet] of all elements.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.toHashSet(): HashSet<T>
public expect fun <T> Sequence<T>.toHashSet(): HashSet<T>
/**
* Returns a [List] containing all elements.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.toList(): List<T>
public expect fun <T> Sequence<T>.toList(): List<T>
/**
* Returns a [MutableList] filled with all elements of this sequence.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.toMutableList(): MutableList<T>
public expect fun <T> Sequence<T>.toMutableList(): MutableList<T>
/**
* Returns a [Set] of all elements.
@@ -409,21 +409,21 @@ public header fun <T> Sequence<T>.toMutableList(): MutableList<T>
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.toSet(): Set<T>
public expect fun <T> Sequence<T>.toSet(): Set<T>
/**
* Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R> Sequence<T>.flatMap(transform: (T) -> Sequence<R>): Sequence<R>
public expect fun <T, R> Sequence<T>.flatMap(transform: (T) -> Sequence<R>): Sequence<R>
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination].
*
* The operation is _terminal_.
*/
public header inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.flatMapTo(destination: C, transform: (T) -> Sequence<R>): C
public expect inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.flatMapTo(destination: C, transform: (T) -> Sequence<R>): C
/**
* Groups elements of the original sequence by the key returned by the given [keySelector] function
@@ -435,7 +435,7 @@ public header inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.flatMap
*
* The operation is _terminal_.
*/
public header inline fun <T, K> Sequence<T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>
public expect inline fun <T, K> Sequence<T>.groupBy(keySelector: (T) -> K): Map<K, List<T>>
/**
* Groups values returned by the [valueTransform] function applied to each element of the original sequence
@@ -448,7 +448,7 @@ public header inline fun <T, K> Sequence<T>.groupBy(keySelector: (T) -> K): Map<
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V> Sequence<T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>>
public expect inline fun <T, K, V> Sequence<T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>>
/**
* Groups elements of the original sequence by the key returned by the given [keySelector] function
@@ -460,7 +460,7 @@ public header inline fun <T, K, V> Sequence<T>.groupBy(keySelector: (T) -> K, va
*
* The operation is _terminal_.
*/
public header inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Sequence<T>.groupByTo(destination: M, keySelector: (T) -> K): M
public expect inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Sequence<T>.groupByTo(destination: M, keySelector: (T) -> K): M
/**
* Groups values returned by the [valueTransform] function applied to each element of the original sequence
@@ -473,7 +473,7 @@ public header inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Sequence<T
*
* The operation is _terminal_.
*/
public header inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Sequence<T>.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
public expect inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Sequence<T>.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
/**
* Creates a [Grouping] source from a sequence to be used later with one of group-and-fold operations
@@ -484,7 +484,7 @@ public header inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Sequenc
* The operation is _intermediate_ and _stateless_.
*/
@SinceKotlin("1.1")
public header inline fun <T, K> Sequence<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
public expect inline fun <T, K> Sequence<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
/**
* Returns a sequence containing the results of applying the given [transform] function
@@ -492,7 +492,7 @@ public header inline fun <T, K> Sequence<T>.groupingBy(crossinline keySelector:
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R> Sequence<T>.map(transform: (T) -> R): Sequence<R>
public expect fun <T, R> Sequence<T>.map(transform: (T) -> R): Sequence<R>
/**
* Returns a sequence containing the results of applying the given [transform] function
@@ -502,7 +502,7 @@ public header fun <T, R> Sequence<T>.map(transform: (T) -> R): Sequence<R>
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R> Sequence<T>.mapIndexed(transform: (index: Int, T) -> R): Sequence<R>
public expect fun <T, R> Sequence<T>.mapIndexed(transform: (index: Int, T) -> R): Sequence<R>
/**
* Returns a sequence containing only the non-null results of applying the given [transform] function
@@ -512,7 +512,7 @@ public header fun <T, R> Sequence<T>.mapIndexed(transform: (index: Int, T) -> R)
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R : Any> Sequence<T>.mapIndexedNotNull(transform: (index: Int, T) -> R?): Sequence<R>
public expect fun <T, R : Any> Sequence<T>.mapIndexedNotNull(transform: (index: Int, T) -> R?): Sequence<R>
/**
* Applies the given [transform] function to each element and its index in the original sequence
@@ -522,7 +522,7 @@ public header fun <T, R : Any> Sequence<T>.mapIndexedNotNull(transform: (index:
*
* The operation is _terminal_.
*/
public header inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C
public expect inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C
/**
* Applies the given [transform] function to each element and its index in the original sequence
@@ -532,7 +532,7 @@ public header inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.m
*
* The operation is _terminal_.
*/
public header inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C
public expect inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C
/**
* Returns a sequence containing only the non-null results of applying the given [transform] function
@@ -540,7 +540,7 @@ public header inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapInde
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R : Any> Sequence<T>.mapNotNull(transform: (T) -> R?): Sequence<R>
public expect fun <T, R : Any> Sequence<T>.mapNotNull(transform: (T) -> R?): Sequence<R>
/**
* Applies the given [transform] function to each element in the original sequence
@@ -548,7 +548,7 @@ public header fun <T, R : Any> Sequence<T>.mapNotNull(transform: (T) -> R?): Seq
*
* The operation is _terminal_.
*/
public header inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.mapNotNullTo(destination: C, transform: (T) -> R?): C
public expect inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.mapNotNullTo(destination: C, transform: (T) -> R?): C
/**
* Applies the given [transform] function to each element of the original sequence
@@ -556,14 +556,14 @@ public header inline fun <T, R : Any, C : MutableCollection<in R>> Sequence<T>.m
*
* The operation is _terminal_.
*/
public header inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapTo(destination: C, transform: (T) -> R): C
public expect inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapTo(destination: C, transform: (T) -> R): C
/**
* Returns a sequence of [IndexedValue] for each element of the original sequence.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T> Sequence<T>.withIndex(): Sequence<IndexedValue<T>>
public expect fun <T> Sequence<T>.withIndex(): Sequence<IndexedValue<T>>
/**
* Returns a sequence containing only distinct elements from the given sequence.
@@ -572,7 +572,7 @@ public header fun <T> Sequence<T>.withIndex(): Sequence<IndexedValue<T>>
*
* The operation is _intermediate_ and _stateful_.
*/
public header fun <T> Sequence<T>.distinct(): Sequence<T>
public expect fun <T> Sequence<T>.distinct(): Sequence<T>
/**
* Returns a sequence containing only elements from the given sequence
@@ -582,7 +582,7 @@ public header fun <T> Sequence<T>.distinct(): Sequence<T>
*
* The operation is _intermediate_ and _stateful_.
*/
public header fun <T, K> Sequence<T>.distinctBy(selector: (T) -> K): Sequence<T>
public expect fun <T, K> Sequence<T>.distinctBy(selector: (T) -> K): Sequence<T>
/**
* Returns a mutable set containing all distinct elements from the given sequence.
@@ -591,49 +591,49 @@ public header fun <T, K> Sequence<T>.distinctBy(selector: (T) -> K): Sequence<T>
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.toMutableSet(): MutableSet<T>
public expect fun <T> Sequence<T>.toMutableSet(): MutableSet<T>
/**
* Returns `true` if all elements match the given [predicate].
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.all(predicate: (T) -> Boolean): Boolean
public expect inline fun <T> Sequence<T>.all(predicate: (T) -> Boolean): Boolean
/**
* Returns `true` if sequence has at least one element.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.any(): Boolean
public expect fun <T> Sequence<T>.any(): Boolean
/**
* Returns `true` if at least one element matches the given [predicate].
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.any(predicate: (T) -> Boolean): Boolean
public expect inline fun <T> Sequence<T>.any(predicate: (T) -> Boolean): Boolean
/**
* Returns the number of elements in this sequence.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.count(): Int
public expect fun <T> Sequence<T>.count(): Int
/**
* Returns the number of elements matching the given [predicate].
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.count(predicate: (T) -> Boolean): Int
public expect inline fun <T> Sequence<T>.count(predicate: (T) -> Boolean): Int
/**
* Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element.
*
* The operation is _terminal_.
*/
public header inline fun <T, R> Sequence<T>.fold(initial: R, operation: (acc: R, T) -> R): R
public expect inline fun <T, R> Sequence<T>.fold(initial: R, operation: (acc: R, T) -> R): R
/**
* Accumulates value starting with [initial] value and applying [operation] from left to right
@@ -643,14 +643,14 @@ public header inline fun <T, R> Sequence<T>.fold(initial: R, operation: (acc: R,
*
* The operation is _terminal_.
*/
public header inline fun <T, R> Sequence<T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R
public expect inline fun <T, R> Sequence<T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R
/**
* Performs the given [action] on each element.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.forEach(action: (T) -> Unit): Unit
public expect inline fun <T> Sequence<T>.forEach(action: (T) -> Unit): Unit
/**
* Performs the given [action] on each element, providing sequential index with the element.
@@ -659,7 +659,7 @@ public header inline fun <T> Sequence<T>.forEach(action: (T) -> Unit): Unit
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.forEachIndexed(action: (index: Int, T) -> Unit): Unit
public expect inline fun <T> Sequence<T>.forEachIndexed(action: (index: Int, T) -> Unit): Unit
/**
* Returns the largest element or `null` if there are no elements.
@@ -669,7 +669,7 @@ public header inline fun <T> Sequence<T>.forEachIndexed(action: (index: Int, T)
* The operation is _terminal_.
*/
@SinceKotlin("1.1")
public header fun Sequence<Double>.max(): Double?
public expect fun Sequence<Double>.max(): Double?
/**
* Returns the largest element or `null` if there are no elements.
@@ -679,28 +679,28 @@ public header fun Sequence<Double>.max(): Double?
* The operation is _terminal_.
*/
@SinceKotlin("1.1")
public header fun Sequence<Float>.max(): Float?
public expect fun Sequence<Float>.max(): Float?
/**
* Returns the largest element or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header fun <T : Comparable<T>> Sequence<T>.max(): T?
public expect fun <T : Comparable<T>> Sequence<T>.max(): T?
/**
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header inline fun <T, R : Comparable<R>> Sequence<T>.maxBy(selector: (T) -> R): T?
public expect inline fun <T, R : Comparable<R>> Sequence<T>.maxBy(selector: (T) -> R): T?
/**
* Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.maxWith(comparator: Comparator<in T>): T?
public expect fun <T> Sequence<T>.maxWith(comparator: Comparator<in T>): T?
/**
* Returns the smallest element or `null` if there are no elements.
@@ -710,7 +710,7 @@ public header fun <T> Sequence<T>.maxWith(comparator: Comparator<in T>): T?
* The operation is _terminal_.
*/
@SinceKotlin("1.1")
public header fun Sequence<Double>.min(): Double?
public expect fun Sequence<Double>.min(): Double?
/**
* Returns the smallest element or `null` if there are no elements.
@@ -720,42 +720,42 @@ public header fun Sequence<Double>.min(): Double?
* The operation is _terminal_.
*/
@SinceKotlin("1.1")
public header fun Sequence<Float>.min(): Float?
public expect fun Sequence<Float>.min(): Float?
/**
* Returns the smallest element or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header fun <T : Comparable<T>> Sequence<T>.min(): T?
public expect fun <T : Comparable<T>> Sequence<T>.min(): T?
/**
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header inline fun <T, R : Comparable<R>> Sequence<T>.minBy(selector: (T) -> R): T?
public expect inline fun <T, R : Comparable<R>> Sequence<T>.minBy(selector: (T) -> R): T?
/**
* Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.minWith(comparator: Comparator<in T>): T?
public expect fun <T> Sequence<T>.minWith(comparator: Comparator<in T>): T?
/**
* Returns `true` if the sequence has no elements.
*
* The operation is _terminal_.
*/
public header fun <T> Sequence<T>.none(): Boolean
public expect fun <T> Sequence<T>.none(): Boolean
/**
* Returns `true` if no elements match the given [predicate].
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.none(predicate: (T) -> Boolean): Boolean
public expect inline fun <T> Sequence<T>.none(predicate: (T) -> Boolean): Boolean
/**
* Returns a sequence which performs the given [action] on each element of the original sequence as they pass though it.
@@ -763,14 +763,14 @@ public header inline fun <T> Sequence<T>.none(predicate: (T) -> Boolean): Boolea
* The operation is _intermediate_ and _stateless_.
*/
@SinceKotlin("1.1")
public header fun <T> Sequence<T>.onEach(action: (T) -> Unit): Sequence<T>
public expect fun <T> Sequence<T>.onEach(action: (T) -> Unit): Sequence<T>
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element.
*
* The operation is _terminal_.
*/
public header inline fun <S, T: S> Sequence<T>.reduce(operation: (acc: S, T) -> S): S
public expect inline fun <S, T: S> Sequence<T>.reduce(operation: (acc: S, T) -> S): S
/**
* Accumulates value starting with the first element and applying [operation] from left to right
@@ -780,35 +780,35 @@ public header inline fun <S, T: S> Sequence<T>.reduce(operation: (acc: S, T) ->
*
* The operation is _terminal_.
*/
public header inline fun <S, T: S> Sequence<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S
public expect inline fun <S, T: S> Sequence<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S
/**
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.sumBy(selector: (T) -> Int): Int
public expect inline fun <T> Sequence<T>.sumBy(selector: (T) -> Int): Int
/**
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.sumByDouble(selector: (T) -> Double): Double
public expect inline fun <T> Sequence<T>.sumByDouble(selector: (T) -> Double): Double
/**
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T : Any> Sequence<T?>.requireNoNulls(): Sequence<T>
public expect fun <T : Any> Sequence<T?>.requireNoNulls(): Sequence<T>
/**
* Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element].
*
* The operation is _intermediate_ and _stateless_.
*/
public header operator fun <T> Sequence<T>.minus(element: T): Sequence<T>
public expect operator fun <T> Sequence<T>.minus(element: T): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] array.
@@ -818,7 +818,7 @@ public header operator fun <T> Sequence<T>.minus(element: T): Sequence<T>
*
* The operation is _intermediate_ and _stateful_.
*/
public header operator fun <T> Sequence<T>.minus(elements: Array<out T>): Sequence<T>
public expect operator fun <T> Sequence<T>.minus(elements: Array<out T>): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] collection.
@@ -828,7 +828,7 @@ public header operator fun <T> Sequence<T>.minus(elements: Array<out T>): Sequen
*
* The operation is _intermediate_ and _stateful_.
*/
public header operator fun <T> Sequence<T>.minus(elements: Iterable<T>): Sequence<T>
public expect operator fun <T> Sequence<T>.minus(elements: Iterable<T>): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] sequence.
@@ -838,7 +838,7 @@ public header operator fun <T> Sequence<T>.minus(elements: Iterable<T>): Sequenc
*
* The operation is _intermediate_ for this sequence and _terminal_ and _stateful_ for the [elements] sequence.
*/
public header operator fun <T> Sequence<T>.minus(elements: Sequence<T>): Sequence<T>
public expect operator fun <T> Sequence<T>.minus(elements: Sequence<T>): Sequence<T>
/**
* Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element].
@@ -846,7 +846,7 @@ public header operator fun <T> Sequence<T>.minus(elements: Sequence<T>): Sequenc
* The operation is _intermediate_ and _stateless_.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T>
public expect inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T>
/**
* Splits the original sequence into pair of lists,
@@ -855,14 +855,14 @@ public header inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T>
*
* The operation is _terminal_.
*/
public header inline fun <T> Sequence<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>
public expect inline fun <T> Sequence<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>>
/**
* Returns a sequence containing all elements of the original sequence and then the given [element].
*
* The operation is _intermediate_ and _stateless_.
*/
public header operator fun <T> Sequence<T>.plus(element: T): Sequence<T>
public expect operator fun <T> Sequence<T>.plus(element: T): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence and then all elements of the given [elements] array.
@@ -872,7 +872,7 @@ public header operator fun <T> Sequence<T>.plus(element: T): Sequence<T>
*
* The operation is _intermediate_ and _stateless_.
*/
public header operator fun <T> Sequence<T>.plus(elements: Array<out T>): Sequence<T>
public expect operator fun <T> Sequence<T>.plus(elements: Array<out T>): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence and then all elements of the given [elements] collection.
@@ -882,7 +882,7 @@ public header operator fun <T> Sequence<T>.plus(elements: Array<out T>): Sequenc
*
* The operation is _intermediate_ and _stateless_.
*/
public header operator fun <T> Sequence<T>.plus(elements: Iterable<T>): Sequence<T>
public expect operator fun <T> Sequence<T>.plus(elements: Iterable<T>): Sequence<T>
/**
* Returns a sequence containing all elements of original sequence and then all elements of the given [elements] sequence.
@@ -892,7 +892,7 @@ public header operator fun <T> Sequence<T>.plus(elements: Iterable<T>): Sequence
*
* The operation is _intermediate_ and _stateless_.
*/
public header operator fun <T> Sequence<T>.plus(elements: Sequence<T>): Sequence<T>
public expect operator fun <T> Sequence<T>.plus(elements: Sequence<T>): Sequence<T>
/**
* Returns a sequence containing all elements of the original sequence and then the given [element].
@@ -900,7 +900,7 @@ public header operator fun <T> Sequence<T>.plus(elements: Sequence<T>): Sequence
* The operation is _intermediate_ and _stateless_.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Sequence<T>.plusElement(element: T): Sequence<T>
public expect inline fun <T> Sequence<T>.plusElement(element: T): Sequence<T>
/**
* Returns a sequence of pairs built from elements of both sequences with same indexes.
@@ -908,14 +908,14 @@ public header inline fun <T> Sequence<T>.plusElement(element: T): Sequence<T>
*
* The operation is _intermediate_ and _stateless_.
*/
public header infix fun <T, R> Sequence<T>.zip(other: Sequence<R>): Sequence<Pair<T, R>>
public expect infix fun <T, R> Sequence<T>.zip(other: Sequence<R>): Sequence<Pair<T, R>>
/**
* Returns a sequence of values built from elements of both collections with same indexes using provided [transform]. Resulting sequence has length of shortest input sequences.
*
* The operation is _intermediate_ and _stateless_.
*/
public header fun <T, R, V> Sequence<T>.zip(other: Sequence<R>, transform: (a: T, b: R) -> V): Sequence<V>
public expect fun <T, R, V> Sequence<T>.zip(other: Sequence<R>, transform: (a: T, b: R) -> V): Sequence<V>
/**
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
@@ -954,13 +954,13 @@ public fun <T> Sequence<T>.joinToString(separator: CharSequence = ", ", prefix:
/**
* Creates an [Iterable] instance that wraps the original sequence returning its elements when being iterated.
*/
public header fun <T> Sequence<T>.asIterable(): Iterable<T>
public expect fun <T> Sequence<T>.asIterable(): Iterable<T>
/**
* Returns this sequence as a [Sequence].
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Sequence<T>.asSequence(): Sequence<T>
public expect inline fun <T> Sequence<T>.asSequence(): Sequence<T>
/**
* Returns an average value of elements in the sequence.
@@ -968,7 +968,7 @@ public header inline fun <T> Sequence<T>.asSequence(): Sequence<T>
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfByte")
public header fun Sequence<Byte>.average(): Double
public expect fun Sequence<Byte>.average(): Double
/**
* Returns an average value of elements in the sequence.
@@ -976,7 +976,7 @@ public header fun Sequence<Byte>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfShort")
public header fun Sequence<Short>.average(): Double
public expect fun Sequence<Short>.average(): Double
/**
* Returns an average value of elements in the sequence.
@@ -984,7 +984,7 @@ public header fun Sequence<Short>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfInt")
public header fun Sequence<Int>.average(): Double
public expect fun Sequence<Int>.average(): Double
/**
* Returns an average value of elements in the sequence.
@@ -992,7 +992,7 @@ public header fun Sequence<Int>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfLong")
public header fun Sequence<Long>.average(): Double
public expect fun Sequence<Long>.average(): Double
/**
* Returns an average value of elements in the sequence.
@@ -1000,7 +1000,7 @@ public header fun Sequence<Long>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfFloat")
public header fun Sequence<Float>.average(): Double
public expect fun Sequence<Float>.average(): Double
/**
* Returns an average value of elements in the sequence.
@@ -1008,7 +1008,7 @@ public header fun Sequence<Float>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("averageOfDouble")
public header fun Sequence<Double>.average(): Double
public expect fun Sequence<Double>.average(): Double
/**
* Returns the sum of all elements in the sequence.
@@ -1016,7 +1016,7 @@ public header fun Sequence<Double>.average(): Double
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfByte")
public header fun Sequence<Byte>.sum(): Int
public expect fun Sequence<Byte>.sum(): Int
/**
* Returns the sum of all elements in the sequence.
@@ -1024,7 +1024,7 @@ public header fun Sequence<Byte>.sum(): Int
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfShort")
public header fun Sequence<Short>.sum(): Int
public expect fun Sequence<Short>.sum(): Int
/**
* Returns the sum of all elements in the sequence.
@@ -1032,7 +1032,7 @@ public header fun Sequence<Short>.sum(): Int
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfInt")
public header fun Sequence<Int>.sum(): Int
public expect fun Sequence<Int>.sum(): Int
/**
* Returns the sum of all elements in the sequence.
@@ -1040,7 +1040,7 @@ public header fun Sequence<Int>.sum(): Int
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfLong")
public header fun Sequence<Long>.sum(): Long
public expect fun Sequence<Long>.sum(): Long
/**
* Returns the sum of all elements in the sequence.
@@ -1048,7 +1048,7 @@ public header fun Sequence<Long>.sum(): Long
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfFloat")
public header fun Sequence<Float>.sum(): Float
public expect fun Sequence<Float>.sum(): Float
/**
* Returns the sum of all elements in the sequence.
@@ -1056,5 +1056,5 @@ public header fun Sequence<Float>.sum(): Float
* The operation is _terminal_.
*/
@kotlin.jvm.JvmName("sumOfDouble")
public header fun Sequence<Double>.sum(): Double
public expect fun Sequence<Double>.sum(): Double
+10 -10
View File
@@ -15,28 +15,28 @@ import kotlin.comparisons.*
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.minus(element: T): Set<T>
public expect operator fun <T> Set<T>.minus(element: T): Set<T>
/**
* Returns a set containing all elements of the original set except the elements contained in the given [elements] array.
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.minus(elements: Array<out T>): Set<T>
public expect operator fun <T> Set<T>.minus(elements: Array<out T>): Set<T>
/**
* Returns a set containing all elements of the original set except the elements contained in the given [elements] collection.
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.minus(elements: Iterable<T>): Set<T>
public expect operator fun <T> Set<T>.minus(elements: Iterable<T>): Set<T>
/**
* Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence.
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>
public expect operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>
/**
* Returns a set containing all elements of the original set except the given [element].
@@ -44,14 +44,14 @@ public header operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>
* The returned set preserves the element iteration order of the original set.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Set<T>.minusElement(element: T): Set<T>
public expect inline fun <T> Set<T>.minusElement(element: T): Set<T>
/**
* Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set.
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.plus(element: T): Set<T>
public expect operator fun <T> Set<T>.plus(element: T): Set<T>
/**
* Returns a set containing all elements of the original set and the given [elements] array,
@@ -59,14 +59,14 @@ public header operator fun <T> Set<T>.plus(element: T): Set<T>
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.plus(elements: Array<out T>): Set<T>
public expect operator fun <T> Set<T>.plus(elements: Array<out T>): Set<T>
/**
* Returns a set containing all elements of the original set and the given [elements] collection,
* which aren't already in this set.
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.plus(elements: Iterable<T>): Set<T>
public expect operator fun <T> Set<T>.plus(elements: Iterable<T>): Set<T>
/**
* Returns a set containing all elements of the original set and the given [elements] sequence,
@@ -74,7 +74,7 @@ public header operator fun <T> Set<T>.plus(elements: Iterable<T>): Set<T>
*
* The returned set preserves the element iteration order of the original set.
*/
public header operator fun <T> Set<T>.plus(elements: Sequence<T>): Set<T>
public expect operator fun <T> Set<T>.plus(elements: Sequence<T>): Set<T>
/**
* Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set.
@@ -82,5 +82,5 @@ public header operator fun <T> Set<T>.plus(elements: Sequence<T>): Set<T>
* The returned set preserves the element iteration order of the original set.
*/
@kotlin.internal.InlineOnly
public header inline fun <T> Set<T>.plusElement(element: T): Set<T>
public expect inline fun <T> Set<T>.plusElement(element: T): Set<T>
+111 -111
View File
@@ -14,279 +14,279 @@ import kotlin.comparisons.*
* Returns a character at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this char sequence.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.elementAt(index: Int): Char
public expect inline fun CharSequence.elementAt(index: Int): Char
/**
* Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char
public expect inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char
/**
* Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.elementAtOrNull(index: Int): Char?
public expect inline fun CharSequence.elementAtOrNull(index: Int): Char?
/**
* Returns the first character matching the given [predicate], or `null` if no such character was found.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.find(predicate: (Char) -> Boolean): Char?
public expect inline fun CharSequence.find(predicate: (Char) -> Boolean): Char?
/**
* Returns the last character matching the given [predicate], or `null` if no such character was found.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char?
public expect inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char?
/**
* Returns first character.
* @throws [NoSuchElementException] if the char sequence is empty.
*/
public header fun CharSequence.first(): Char
public expect fun CharSequence.first(): Char
/**
* Returns the first character matching the given [predicate].
* @throws [NoSuchElementException] if no such character is found.
*/
public header inline fun CharSequence.first(predicate: (Char) -> Boolean): Char
public expect inline fun CharSequence.first(predicate: (Char) -> Boolean): Char
/**
* Returns the first character, or `null` if the char sequence is empty.
*/
public header fun CharSequence.firstOrNull(): Char?
public expect fun CharSequence.firstOrNull(): Char?
/**
* Returns the first character matching the given [predicate], or `null` if character was not found.
*/
public header inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char?
public expect inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char?
/**
* Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char
public expect inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char
/**
* Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence.
*/
public header fun CharSequence.getOrNull(index: Int): Char?
public expect fun CharSequence.getOrNull(index: Int): Char?
/**
* Returns index of the first character matching the given [predicate], or -1 if the char sequence does not contain such character.
*/
public header inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int
public expect inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int
/**
* Returns index of the last character matching the given [predicate], or -1 if the char sequence does not contain such character.
*/
public header inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int
public expect inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int
/**
* Returns the last character.
* @throws [NoSuchElementException] if the char sequence is empty.
*/
public header fun CharSequence.last(): Char
public expect fun CharSequence.last(): Char
/**
* Returns the last character matching the given [predicate].
* @throws [NoSuchElementException] if no such character is found.
*/
public header inline fun CharSequence.last(predicate: (Char) -> Boolean): Char
public expect inline fun CharSequence.last(predicate: (Char) -> Boolean): Char
/**
* Returns the last character, or `null` if the char sequence is empty.
*/
public header fun CharSequence.lastOrNull(): Char?
public expect fun CharSequence.lastOrNull(): Char?
/**
* Returns the last character matching the given [predicate], or `null` if no such character was found.
*/
public header inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?
public expect inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?
/**
* Returns the single character, or throws an exception if the char sequence is empty or has more than one character.
*/
public header fun CharSequence.single(): Char
public expect fun CharSequence.single(): Char
/**
* Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character.
*/
public header inline fun CharSequence.single(predicate: (Char) -> Boolean): Char
public expect inline fun CharSequence.single(predicate: (Char) -> Boolean): Char
/**
* Returns single character, or `null` if the char sequence is empty or has more than one character.
*/
public header fun CharSequence.singleOrNull(): Char?
public expect fun CharSequence.singleOrNull(): Char?
/**
* Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found.
*/
public header inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char?
public expect inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char?
/**
* Returns a subsequence of this char sequence with the first [n] characters removed.
*/
public header fun CharSequence.drop(n: Int): CharSequence
public expect fun CharSequence.drop(n: Int): CharSequence
/**
* Returns a string with the first [n] characters removed.
*/
public header fun String.drop(n: Int): String
public expect fun String.drop(n: Int): String
/**
* Returns a subsequence of this char sequence with the last [n] characters removed.
*/
public header fun CharSequence.dropLast(n: Int): CharSequence
public expect fun CharSequence.dropLast(n: Int): CharSequence
/**
* Returns a string with the last [n] characters removed.
*/
public header fun String.dropLast(n: Int): String
public expect fun String.dropLast(n: Int): String
/**
* Returns a subsequence of this char sequence containing all characters except last characters that satisfy the given [predicate].
*/
public header inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing all characters except last characters that satisfy the given [predicate].
*/
public header inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String
public expect inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String
/**
* Returns a subsequence of this char sequence containing all characters except first characters that satisfy the given [predicate].
*/
public header inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing all characters except first characters that satisfy the given [predicate].
*/
public header inline fun String.dropWhile(predicate: (Char) -> Boolean): String
public expect inline fun String.dropWhile(predicate: (Char) -> Boolean): String
/**
* Returns a char sequence containing only those characters from the original char sequence that match the given [predicate].
*/
public header inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing only those characters from the original string that match the given [predicate].
*/
public header inline fun String.filter(predicate: (Char) -> Boolean): String
public expect inline fun String.filter(predicate: (Char) -> Boolean): String
/**
* Returns a char sequence containing only those characters from the original char sequence that match the given [predicate].
* @param [predicate] function that takes the index of a character and the character itself
* and returns the result of predicate evaluation on the character.
*/
public header inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence
public expect inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence
/**
* Returns a string containing only those characters from the original string that match the given [predicate].
* @param [predicate] function that takes the index of a character and the character itself
* and returns the result of predicate evaluation on the character.
*/
public header inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String
public expect inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String
/**
* Appends all characters matching the given [predicate] to the given [destination].
* @param [predicate] function that takes the index of a character and the character itself
* and returns the result of predicate evaluation on the character.
*/
public header inline fun <C : Appendable> CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C
public expect inline fun <C : Appendable> CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C
/**
* Returns a char sequence containing only those characters from the original char sequence that do not match the given [predicate].
*/
public header inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing only those characters from the original string that do not match the given [predicate].
*/
public header inline fun String.filterNot(predicate: (Char) -> Boolean): String
public expect inline fun String.filterNot(predicate: (Char) -> Boolean): String
/**
* Appends all characters not matching the given [predicate] to the given [destination].
*/
public header inline fun <C : Appendable> CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C
public expect inline fun <C : Appendable> CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C
/**
* Appends all characters matching the given [predicate] to the given [destination].
*/
public header inline fun <C : Appendable> CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C
public expect inline fun <C : Appendable> CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C
/**
* Returns a char sequence containing characters of the original char sequence at the specified range of [indices].
*/
public header fun CharSequence.slice(indices: IntRange): CharSequence
public expect fun CharSequence.slice(indices: IntRange): CharSequence
/**
* Returns a string containing characters of the original string at the specified range of [indices].
*/
public header fun String.slice(indices: IntRange): String
public expect fun String.slice(indices: IntRange): String
/**
* Returns a char sequence containing characters of the original char sequence at specified [indices].
*/
public header fun CharSequence.slice(indices: Iterable<Int>): CharSequence
public expect fun CharSequence.slice(indices: Iterable<Int>): CharSequence
/**
* Returns a string containing characters of the original string at specified [indices].
*/
@kotlin.internal.InlineOnly
public header inline fun String.slice(indices: Iterable<Int>): String
public expect inline fun String.slice(indices: Iterable<Int>): String
/**
* Returns a subsequence of this char sequence containing the first [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter.
*/
public header fun CharSequence.take(n: Int): CharSequence
public expect fun CharSequence.take(n: Int): CharSequence
/**
* Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter.
*/
public header fun String.take(n: Int): String
public expect fun String.take(n: Int): String
/**
* Returns a subsequence of this char sequence containing the last [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter.
*/
public header fun CharSequence.takeLast(n: Int): CharSequence
public expect fun CharSequence.takeLast(n: Int): CharSequence
/**
* Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter.
*/
public header fun String.takeLast(n: Int): String
public expect fun String.takeLast(n: Int): String
/**
* Returns a subsequence of this char sequence containing last characters that satisfy the given [predicate].
*/
public header inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing last characters that satisfy the given [predicate].
*/
public header inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String
public expect inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String
/**
* Returns a subsequence of this char sequence containing the first characters that satisfy the given [predicate].
*/
public header inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence
public expect inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence
/**
* Returns a string containing the first characters that satisfy the given [predicate].
*/
public header inline fun String.takeWhile(predicate: (Char) -> Boolean): String
public expect inline fun String.takeWhile(predicate: (Char) -> Boolean): String
/**
* Returns a char sequence with characters in reversed order.
*/
public header fun CharSequence.reversed(): CharSequence
public expect fun CharSequence.reversed(): CharSequence
/**
* Returns a string with characters in reversed order.
*/
@kotlin.internal.InlineOnly
public header inline fun String.reversed(): String
public expect inline fun String.reversed(): String
/**
* Returns a [Map] containing key-value pairs provided by [transform] function
@@ -296,7 +296,7 @@ public header inline fun String.reversed(): String
*
* The returned map preserves the entry iteration order of the original char sequence.
*/
public header inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
public expect inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
/**
* Returns a [Map] containing the characters from the given char sequence indexed by the key
@@ -306,7 +306,7 @@ public header inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair
*
* The returned map preserves the entry iteration order of the original char sequence.
*/
public header inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char>
public expect inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char>
/**
* Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to characters of the given char sequence.
@@ -315,7 +315,7 @@ public header inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K):
*
* The returned map preserves the entry iteration order of the original char sequence.
*/
public header inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
public expect inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
/**
* Populates and returns the [destination] mutable map with key-value pairs,
@@ -324,7 +324,7 @@ public header inline fun <K, V> CharSequence.associateBy(keySelector: (Char) ->
*
* If any two characters would have the same key returned by [keySelector] the last one gets added to the map.
*/
public header inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M
public expect inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M
/**
* Populates and returns the [destination] mutable map with key-value pairs,
@@ -333,7 +333,7 @@ public header inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associa
*
* If any two characters would have the same key returned by [keySelector] the last one gets added to the map.
*/
public header inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
public expect inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
/**
* Populates and returns the [destination] mutable map with key-value pairs
@@ -341,44 +341,44 @@ public header inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associa
*
* If any of two pairs would have the same key the last one gets added to the map.
*/
public header inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
public expect inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
/**
* Appends all characters to the given [destination] collection.
*/
public header fun <C : MutableCollection<in Char>> CharSequence.toCollection(destination: C): C
public expect fun <C : MutableCollection<in Char>> CharSequence.toCollection(destination: C): C
/**
* Returns a [HashSet] of all characters.
*/
public header fun CharSequence.toHashSet(): HashSet<Char>
public expect fun CharSequence.toHashSet(): HashSet<Char>
/**
* Returns a [List] containing all characters.
*/
public header fun CharSequence.toList(): List<Char>
public expect fun CharSequence.toList(): List<Char>
/**
* Returns a [MutableList] filled with all characters of this char sequence.
*/
public header fun CharSequence.toMutableList(): MutableList<Char>
public expect fun CharSequence.toMutableList(): MutableList<Char>
/**
* Returns a [Set] of all characters.
*
* The returned set preserves the element iteration order of the original char sequence.
*/
public header fun CharSequence.toSet(): Set<Char>
public expect fun CharSequence.toSet(): Set<Char>
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each character of original char sequence.
*/
public header inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R>
public expect inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R>
/**
* Appends all elements yielded from results of [transform] function being invoked on each character of original char sequence, to the given [destination].
*/
public header inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C
public expect inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C
/**
* Groups characters of the original char sequence by the key returned by the given [keySelector] function
@@ -388,7 +388,7 @@ public header inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo
*
* @sample samples.collections.Collections.Transformations.groupBy
*/
public header inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>
public expect inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>
/**
* Groups values returned by the [valueTransform] function applied to each character of the original char sequence
@@ -399,7 +399,7 @@ public header inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map
*
* @sample samples.collections.Collections.Transformations.groupByKeysAndValues
*/
public header inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>
public expect inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>
/**
* Groups characters of the original char sequence by the key returned by the given [keySelector] function
@@ -409,7 +409,7 @@ public header inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, v
*
* @sample samples.collections.Collections.Transformations.groupBy
*/
public header inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M
public expect inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M
/**
* Groups values returned by the [valueTransform] function applied to each character of the original char sequence
@@ -420,7 +420,7 @@ public header inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequen
*
* @sample samples.collections.Collections.Transformations.groupByKeysAndValues
*/
public header inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
public expect inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
/**
* Creates a [Grouping] source from a char sequence to be used later with one of group-and-fold operations
@@ -429,13 +429,13 @@ public header inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequen
* @sample samples.collections.Collections.Transformations.groupingByEachCount
*/
@SinceKotlin("1.1")
public header inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>
public expect inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>
/**
* Returns a list containing the results of applying the given [transform] function
* to each character in the original char sequence.
*/
public header inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>
public expect inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>
/**
* Returns a list containing the results of applying the given [transform] function
@@ -443,7 +443,7 @@ public header inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>
* @param [transform] function that takes the index of a character and the character itself
* and returns the result of the transform applied to the character.
*/
public header inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List<R>
public expect inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List<R>
/**
* Returns a list containing only the non-null results of applying the given [transform] function
@@ -451,7 +451,7 @@ public header inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Cha
* @param [transform] function that takes the index of a character and the character itself
* and returns the result of the transform applied to the character.
*/
public header inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List<R>
public expect inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List<R>
/**
* Applies the given [transform] function to each character and its index in the original char sequence
@@ -459,7 +459,7 @@ public header inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (in
* @param [transform] function that takes the index of a character and the character itself
* and returns the result of the transform applied to the character.
*/
public header inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C
public expect inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C
/**
* Applies the given [transform] function to each character and its index in the original char sequence
@@ -467,61 +467,61 @@ public header inline fun <R : Any, C : MutableCollection<in R>> CharSequence.map
* @param [transform] function that takes the index of a character and the character itself
* and returns the result of the transform applied to the character.
*/
public header inline fun <R, C : MutableCollection<in R>> CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C
public expect inline fun <R, C : MutableCollection<in R>> CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C
/**
* Returns a list containing only the non-null results of applying the given [transform] function
* to each character in the original char sequence.
*/
public header inline fun <R : Any> CharSequence.mapNotNull(transform: (Char) -> R?): List<R>
public expect inline fun <R : Any> CharSequence.mapNotNull(transform: (Char) -> R?): List<R>
/**
* Applies the given [transform] function to each character in the original char sequence
* and appends only the non-null results to the given [destination].
*/
public header inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C
public expect inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C
/**
* Applies the given [transform] function to each character of the original char sequence
* and appends the results to the given [destination].
*/
public header inline fun <R, C : MutableCollection<in R>> CharSequence.mapTo(destination: C, transform: (Char) -> R): C
public expect inline fun <R, C : MutableCollection<in R>> CharSequence.mapTo(destination: C, transform: (Char) -> R): C
/**
* Returns a lazy [Iterable] of [IndexedValue] for each character of the original char sequence.
*/
public header fun CharSequence.withIndex(): Iterable<IndexedValue<Char>>
public expect fun CharSequence.withIndex(): Iterable<IndexedValue<Char>>
/**
* Returns `true` if all characters match the given [predicate].
*/
public header inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean
public expect inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean
/**
* Returns `true` if char sequence has at least one character.
*/
public header fun CharSequence.any(): Boolean
public expect fun CharSequence.any(): Boolean
/**
* Returns `true` if at least one character matches the given [predicate].
*/
public header inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean
public expect inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean
/**
* Returns the length of this char sequence.
*/
@kotlin.internal.InlineOnly
public header inline fun CharSequence.count(): Int
public expect inline fun CharSequence.count(): Int
/**
* Returns the number of characters matching the given [predicate].
*/
public header inline fun CharSequence.count(predicate: (Char) -> Boolean): Int
public expect inline fun CharSequence.count(predicate: (Char) -> Boolean): Int
/**
* Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each character.
*/
public header inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R
public expect inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R
/**
* Accumulates value starting with [initial] value and applying [operation] from left to right
@@ -529,12 +529,12 @@ public header inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, C
* @param [operation] function that takes the index of a character, current accumulator value
* and the character itself, and calculates the next accumulator value.
*/
public header inline fun <R> CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R
public expect inline fun <R> CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R
/**
* Accumulates value starting with [initial] value and applying [operation] from right to left to each character and current accumulator value.
*/
public header inline fun <R> CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R
public expect inline fun <R> CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R
/**
* Accumulates value starting with [initial] value and applying [operation] from right to left
@@ -542,70 +542,70 @@ public header inline fun <R> CharSequence.foldRight(initial: R, operation: (Char
* @param [operation] function that takes the index of a character, the character itself
* and current accumulator value, and calculates the next accumulator value.
*/
public header inline fun <R> CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R
public expect inline fun <R> CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R
/**
* Performs the given [action] on each character.
*/
public header inline fun CharSequence.forEach(action: (Char) -> Unit): Unit
public expect inline fun CharSequence.forEach(action: (Char) -> Unit): Unit
/**
* Performs the given [action] on each character, providing sequential index with the character.
* @param [action] function that takes the index of a character and the character itself
* and performs the desired action on the character.
*/
public header inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit): Unit
public expect inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit): Unit
/**
* Returns the largest character or `null` if there are no characters.
*/
public header fun CharSequence.max(): Char?
public expect fun CharSequence.max(): Char?
/**
* Returns the first character yielding the largest value of the given function or `null` if there are no characters.
*/
public header inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
public expect inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
/**
* Returns the first character having the largest value according to the provided [comparator] or `null` if there are no characters.
*/
public header fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
public expect fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
/**
* Returns the smallest character or `null` if there are no characters.
*/
public header fun CharSequence.min(): Char?
public expect fun CharSequence.min(): Char?
/**
* Returns the first character yielding the smallest value of the given function or `null` if there are no characters.
*/
public header inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
public expect inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
/**
* Returns the first character having the smallest value according to the provided [comparator] or `null` if there are no characters.
*/
public header fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
public expect fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
/**
* Returns `true` if the char sequence has no characters.
*/
public header fun CharSequence.none(): Boolean
public expect fun CharSequence.none(): Boolean
/**
* Returns `true` if no characters match the given [predicate].
*/
public header inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean
public expect inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean
/**
* Performs the given [action] on each character and returns the char sequence itself afterwards.
*/
@SinceKotlin("1.1")
public header inline fun <S : CharSequence> S.onEach(action: (Char) -> Unit): S
public expect inline fun <S : CharSequence> S.onEach(action: (Char) -> Unit): S
/**
* Accumulates value starting with the first character and applying [operation] from left to right to current accumulator value and each character.
*/
public header inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char
public expect inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char
/**
* Accumulates value starting with the first character and applying [operation] from left to right
@@ -613,12 +613,12 @@ public header inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Cha
* @param [operation] function that takes the index of a character, current accumulator value
* and the character itself and calculates the next accumulator value.
*/
public header inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char
public expect inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char
/**
* Accumulates value starting with last character and applying [operation] from right to left to each character and current accumulator value.
*/
public header inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char
public expect inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char
/**
* Accumulates value starting with last character and applying [operation] from right to left
@@ -626,49 +626,49 @@ public header inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -
* @param [operation] function that takes the index of a character, the character itself
* and current accumulator value, and calculates the next accumulator value.
*/
public header inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
public expect inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
/**
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
*/
public header inline fun CharSequence.sumBy(selector: (Char) -> Int): Int
public expect inline fun CharSequence.sumBy(selector: (Char) -> Int): Int
/**
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
*/
public header inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double
public expect inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double
/**
* Splits the original char sequence into pair of char sequences,
* where *first* char sequence contains characters for which [predicate] yielded `true`,
* while *second* char sequence contains characters for which [predicate] yielded `false`.
*/
public header inline fun CharSequence.partition(predicate: (Char) -> Boolean): Pair<CharSequence, CharSequence>
public expect inline fun CharSequence.partition(predicate: (Char) -> Boolean): Pair<CharSequence, CharSequence>
/**
* Splits the original string into pair of strings,
* where *first* string contains characters for which [predicate] yielded `true`,
* while *second* string contains characters for which [predicate] yielded `false`.
*/
public header inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String>
public expect inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String>
/**
* Returns a list of pairs built from characters of both char sequences with same indexes. List has length of shortest char sequence.
*/
public header infix fun CharSequence.zip(other: CharSequence): List<Pair<Char, Char>>
public expect infix fun CharSequence.zip(other: CharSequence): List<Pair<Char, Char>>
/**
* Returns a list of values built from characters of both char sequences with same indexes using provided [transform]. List has length of shortest char sequence.
*/
public header inline fun <V> CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List<V>
public expect inline fun <V> CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List<V>
/**
* Creates an [Iterable] instance that wraps the original char sequence returning its characters when being iterated.
*/
public header fun CharSequence.asIterable(): Iterable<Char>
public expect fun CharSequence.asIterable(): Iterable<Char>
/**
* Creates a [Sequence] instance that wraps the original char sequence returning its characters when being iterated.
*/
public header fun CharSequence.asSequence(): Sequence<Char>
public expect fun CharSequence.asSequence(): Sequence<Char>