All Downloads are FREE. Search and download functionalities are using the official Maven repository.

core.kotlin_special.kt Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package kotlin.collections

//
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//

import java.util.*

import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js

/**
 * Returns a [List] that wraps the original array.
 */
public fun  Array.asList(): List {
    val al = ArrayList()
    al.asDynamic().array = this    // black dynamic magic
    return al
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun BooleanArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun ByteArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun CharArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun DoubleArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun FloatArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun IntArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun LongArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns a [List] that wraps the original array.
 */
public inline fun ShortArray.asList(): List {
    return (this as Array).asList()
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun  Array.copyOf(): Array {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.copyOf(): BooleanArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.copyOf(): ByteArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.copyOf(): CharArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.copyOf(): DoubleArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.copyOf(): FloatArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.copyOf(): IntArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.copyOf(): LongArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.copyOf(): ShortArray {
    return this.asDynamic().slice(0)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun ByteArray.copyOf(newSize: Int): ByteArray {
    return arrayCopyResize(this, newSize, 0)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun ShortArray.copyOf(newSize: Int): ShortArray {
    return arrayCopyResize(this, newSize, 0)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun IntArray.copyOf(newSize: Int): IntArray {
    return arrayCopyResize(this, newSize, 0)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun LongArray.copyOf(newSize: Int): LongArray {
    return arrayCopyResize(this, newSize, 0L)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun FloatArray.copyOf(newSize: Int): FloatArray {
    return arrayCopyResize(this, newSize, 0.0f)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun DoubleArray.copyOf(newSize: Int): DoubleArray {
    return arrayCopyResize(this, newSize, 0.0)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun BooleanArray.copyOf(newSize: Int): BooleanArray {
    return arrayCopyResize(this, newSize, false)
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun CharArray.copyOf(newSize: Int): CharArray {
    return arrayCopyResize(this, newSize, '\u0000')
}

/**
 * Returns new array which is a copy of the original array.
 */
public fun  Array.copyOf(newSize: Int): Array {
    return arrayCopyResize(this, newSize, null)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun  Array.copyOfRange(fromIndex: Int, toIndex: Int): Array {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns new array which is a copy of range of original array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray {
    return this.asDynamic().slice(fromIndex, toIndex)
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun  Array.plus(element: T): Array {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun BooleanArray.plus(element: Boolean): BooleanArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun ByteArray.plus(element: Byte): ByteArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun CharArray.plus(element: Char): CharArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun DoubleArray.plus(element: Double): DoubleArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun FloatArray.plus(element: Float): FloatArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun IntArray.plus(element: Int): IntArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun LongArray.plus(element: Long): LongArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun ShortArray.plus(element: Short): ShortArray {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun  Array.plus(elements: Collection): Array {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun BooleanArray.plus(elements: Collection): BooleanArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun ByteArray.plus(elements: Collection): ByteArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun CharArray.plus(elements: Collection): CharArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun DoubleArray.plus(elements: Collection): DoubleArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun FloatArray.plus(elements: Collection): FloatArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun IntArray.plus(elements: Collection): IntArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun LongArray.plus(elements: Collection): LongArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */
public operator fun ShortArray.plus(elements: Collection): ShortArray {
    return arrayPlusCollection(this, elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun  Array.plus(elements: Array): Array {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun ByteArray.plus(elements: ByteArray): ByteArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun CharArray.plus(elements: CharArray): CharArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun FloatArray.plus(elements: FloatArray): FloatArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun IntArray.plus(elements: IntArray): IntArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun LongArray.plus(elements: LongArray): LongArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
@Suppress("NOTHING_TO_INLINE")
public inline operator fun ShortArray.plus(elements: ShortArray): ShortArray {
    return this.asDynamic().concat(elements)
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@Suppress("NOTHING_TO_INLINE")
public inline fun  Array.plusElement(element: T): Array {
    return this.asDynamic().concat(arrayOf(element))
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun ByteArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun CharArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun DoubleArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun FloatArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun IntArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
@library("primitiveArraySort")
public fun ShortArray.sort(): Unit {
    return noImpl
}

/**
 * Sorts the array in-place.
 */
public fun > Array.sort(): Unit {
    if (size > 1)
        sort { a: T, b: T -> a.compareTo(b) }
}

/**
 * Sorts the array in-place.
 */
public fun LongArray.sort(): Unit {
    if (size > 1)
        sort { a: Long, b: Long -> a.compareTo(b) }
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun  Array.sort(comparison: (T, T) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun ByteArray.sort(comparison: (Byte, Byte) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun CharArray.sort(comparison: (Char, Char) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun DoubleArray.sort(comparison: (Double, Double) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun FloatArray.sort(comparison: (Float, Float) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun IntArray.sort(comparison: (Int, Int) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun LongArray.sort(comparison: (Long, Long) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@native
public fun ShortArray.sort(comparison: (Short, Short) -> Int): Unit {
    return noImpl
}

/**
 * Sorts the array in-place according to the order specified by the given [comparator] object.
 */
public fun  Array.sortWith(comparator: Comparator): Unit {
    if (size > 1)
        sort { a, b -> comparator.compare(a, b) }
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun BooleanArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun ByteArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun CharArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun DoubleArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun FloatArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun IntArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun LongArray.toTypedArray(): Array {
    return copyOf() as Array
}

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */
public fun ShortArray.toTypedArray(): Array {
    return copyOf() as Array
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy