Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility instead of removed multipart facade class. It contains only non-inline functions of the latter.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
@file:kotlin.jvm.JvmMultifileClass
|
||||
@file:kotlin.jvm.JvmName("UArraysKt")
|
||||
@file:kotlin.jvm.JvmPackageName("kotlin.collections.unsigned")
|
||||
|
||||
package kotlin.collections
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ module kotlin.stdlib {
|
||||
exports kotlin;
|
||||
exports kotlin.annotation;
|
||||
exports kotlin.collections;
|
||||
exports kotlin.collections.unsigned;
|
||||
exports kotlin.comparisons;
|
||||
exports kotlin.concurrent;
|
||||
exports kotlin.contracts;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
@file:kotlin.jvm.JvmMultifileClass
|
||||
@file:kotlin.jvm.JvmName("UArraysKt")
|
||||
@file:kotlin.jvm.JvmPackageName("kotlin.collections.unsigned")
|
||||
|
||||
package kotlin.collections
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.collections
|
||||
|
||||
import kotlin.random.Random
|
||||
|
||||
@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN)
|
||||
public object UArraysKt {
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UIntArray.random(random: Random): UInt {
|
||||
if (isEmpty())
|
||||
throw NoSuchElementException("Array is empty.")
|
||||
return get(random.nextInt(size))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun ULongArray.random(random: Random): ULong {
|
||||
if (isEmpty())
|
||||
throw NoSuchElementException("Array is empty.")
|
||||
return get(random.nextInt(size))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UByteArray.random(random: Random): UByte {
|
||||
if (isEmpty())
|
||||
throw NoSuchElementException("Array is empty.")
|
||||
return get(random.nextInt(size))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UShortArray.random(random: Random): UShort {
|
||||
if (isEmpty())
|
||||
throw NoSuchElementException("Array is empty.")
|
||||
return get(random.nextInt(size))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public infix fun UIntArray.contentEquals(other: UIntArray): Boolean {
|
||||
return storage.contentEquals(other.storage)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public infix fun ULongArray.contentEquals(other: ULongArray): Boolean {
|
||||
return storage.contentEquals(other.storage)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public infix fun UByteArray.contentEquals(other: UByteArray): Boolean {
|
||||
return storage.contentEquals(other.storage)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public infix fun UShortArray.contentEquals(other: UShortArray): Boolean {
|
||||
return storage.contentEquals(other.storage)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UIntArray.contentHashCode(): Int {
|
||||
return storage.contentHashCode()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun ULongArray.contentHashCode(): Int {
|
||||
return storage.contentHashCode()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UByteArray.contentHashCode(): Int {
|
||||
return storage.contentHashCode()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UShortArray.contentHashCode(): Int {
|
||||
return storage.contentHashCode()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UIntArray.contentToString(): String {
|
||||
return joinToString(", ", "[", "]")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun ULongArray.contentToString(): String {
|
||||
return joinToString(", ", "[", "]")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UByteArray.contentToString(): String {
|
||||
return joinToString(", ", "[", "]")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UShortArray.contentToString(): String {
|
||||
return joinToString(", ", "[", "]")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UIntArray.toTypedArray(): Array<UInt> {
|
||||
return Array(size) { index -> this[index] }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun ULongArray.toTypedArray(): Array<ULong> {
|
||||
return Array(size) { index -> this[index] }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UByteArray.toTypedArray(): Array<UByte> {
|
||||
return Array(size) { index -> this[index] }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun UShortArray.toTypedArray(): Array<UShort> {
|
||||
return Array(size) { index -> this[index] }
|
||||
}
|
||||
|
||||
}
|
||||
+67
-43
@@ -2287,6 +2287,73 @@ public abstract class kotlin/collections/ShortIterator : java/util/Iterator, kot
|
||||
}
|
||||
|
||||
public final class kotlin/collections/UArraysKt {
|
||||
public static final field INSTANCE Lkotlin/collections/UArraysKt;
|
||||
public static final fun contentEquals-ctEhBpI ([I[I)Z
|
||||
public static final fun contentEquals-kdPth3s ([B[B)Z
|
||||
public static final fun contentEquals-mazbYpA ([S[S)Z
|
||||
public static final fun contentEquals-us8wMrg ([J[J)Z
|
||||
public static final fun contentHashCode--ajY-9A ([I)I
|
||||
public static final fun contentHashCode-GBYM_sE ([B)I
|
||||
public static final fun contentHashCode-QwZRm1k ([J)I
|
||||
public static final fun contentHashCode-rL5Bavg ([S)I
|
||||
public static final fun contentToString--ajY-9A ([I)Ljava/lang/String;
|
||||
public static final fun contentToString-GBYM_sE ([B)Ljava/lang/String;
|
||||
public static final fun contentToString-QwZRm1k ([J)Ljava/lang/String;
|
||||
public static final fun contentToString-rL5Bavg ([S)Ljava/lang/String;
|
||||
public static final fun random-2D5oskM ([ILkotlin/random/Random;)I
|
||||
public static final fun random-JzugnMA ([JLkotlin/random/Random;)J
|
||||
public static final fun random-oSF2wD8 ([BLkotlin/random/Random;)B
|
||||
public static final fun random-s5X_as8 ([SLkotlin/random/Random;)S
|
||||
public static final fun toTypedArray--ajY-9A ([I)[Lkotlin/UInt;
|
||||
public static final fun toTypedArray-GBYM_sE ([B)[Lkotlin/UByte;
|
||||
public static final fun toTypedArray-QwZRm1k ([J)[Lkotlin/ULong;
|
||||
public static final fun toTypedArray-rL5Bavg ([S)[Lkotlin/UShort;
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UByteIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UByte;
|
||||
public abstract fun nextUByte ()B
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public final class kotlin/collections/UCollectionsKt {
|
||||
public static final fun sumOfUByte (Ljava/lang/Iterable;)I
|
||||
public static final fun sumOfUInt (Ljava/lang/Iterable;)I
|
||||
public static final fun sumOfULong (Ljava/lang/Iterable;)J
|
||||
public static final fun sumOfUShort (Ljava/lang/Iterable;)I
|
||||
public static final fun toUByteArray (Ljava/util/Collection;)[B
|
||||
public static final fun toUIntArray (Ljava/util/Collection;)[I
|
||||
public static final fun toULongArray (Ljava/util/Collection;)[J
|
||||
public static final fun toUShortArray (Ljava/util/Collection;)[S
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UIntIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UInt;
|
||||
public abstract fun nextUInt ()I
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/ULongIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/ULong;
|
||||
public abstract fun nextULong ()J
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UShortIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UShort;
|
||||
public abstract fun nextUShort ()S
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public final class kotlin/collections/unsigned/UArraysKt {
|
||||
public static final fun asList--ajY-9A ([I)Ljava/util/List;
|
||||
public static final fun asList-GBYM_sE ([B)Ljava/util/List;
|
||||
public static final fun asList-QwZRm1k ([J)Ljava/util/List;
|
||||
@@ -2457,49 +2524,6 @@ public final class kotlin/collections/UArraysKt {
|
||||
public static final fun zip-us8wMrg ([J[J)Ljava/util/List;
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UByteIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UByte;
|
||||
public abstract fun nextUByte ()B
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public final class kotlin/collections/UCollectionsKt {
|
||||
public static final fun sumOfUByte (Ljava/lang/Iterable;)I
|
||||
public static final fun sumOfUInt (Ljava/lang/Iterable;)I
|
||||
public static final fun sumOfULong (Ljava/lang/Iterable;)J
|
||||
public static final fun sumOfUShort (Ljava/lang/Iterable;)I
|
||||
public static final fun toUByteArray (Ljava/util/Collection;)[B
|
||||
public static final fun toUIntArray (Ljava/util/Collection;)[I
|
||||
public static final fun toULongArray (Ljava/util/Collection;)[J
|
||||
public static final fun toUShortArray (Ljava/util/Collection;)[S
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UIntIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UInt;
|
||||
public abstract fun nextUInt ()I
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/ULongIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/ULong;
|
||||
public abstract fun nextULong ()J
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public abstract class kotlin/collections/UShortIterator : java/util/Iterator, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
public fun <init> ()V
|
||||
public synthetic fun next ()Ljava/lang/Object;
|
||||
public final fun next ()Lkotlin/UShort;
|
||||
public abstract fun nextUShort ()S
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public final class kotlin/comparisons/ComparisonsKt {
|
||||
public static final fun compareBy ([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;
|
||||
public static final fun compareValues (Ljava/lang/Comparable;Ljava/lang/Comparable;)I
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
package templates
|
||||
|
||||
enum class SourceFile(jvmClassName: String? = null, val multifile: Boolean = true, val packageName: String? = null) {
|
||||
enum class SourceFile(jvmClassName: String? = null, val multifile: Boolean = true, val packageName: String? = null, val jvmPackageName: String? = null) {
|
||||
|
||||
Arrays(packageName = "kotlin.collections"),
|
||||
UArrays(packageName = "kotlin.collections"),
|
||||
UArrays(packageName = "kotlin.collections", jvmPackageName = "kotlin.collections.unsigned"),
|
||||
Collections(packageName = "kotlin.collections"),
|
||||
UCollections(packageName = "kotlin.collections"),
|
||||
Sets(packageName = "kotlin.collections"),
|
||||
|
||||
@@ -84,6 +84,9 @@ fun List<MemberBuilder>.writeTo(file: File, targetedSource: TargetedSourceFile)
|
||||
}
|
||||
|
||||
writer.appendln("@file:kotlin.jvm.JvmName(\"${sourceFile.jvmClassName}\")")
|
||||
sourceFile.jvmPackageName?.let {
|
||||
writer.appendln("@file:kotlin.jvm.JvmPackageName(\"$it\")")
|
||||
}
|
||||
writer.appendln()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user