Adjust stdlib to size transformation
This commit is contained in:
@@ -10445,7 +10445,7 @@ public fun <T> Array<out T>.asList(): List<T> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun BooleanArray.asList(): List<Boolean> {
|
||||
return object : AbstractList<Boolean>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Boolean)
|
||||
override fun iterator(): MutableIterator<Boolean> = this@asList.iterator() as MutableIterator<Boolean>
|
||||
@@ -10461,7 +10461,7 @@ public fun BooleanArray.asList(): List<Boolean> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun ByteArray.asList(): List<Byte> {
|
||||
return object : AbstractList<Byte>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Byte)
|
||||
override fun iterator(): MutableIterator<Byte> = this@asList.iterator() as MutableIterator<Byte>
|
||||
@@ -10477,7 +10477,7 @@ public fun ByteArray.asList(): List<Byte> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun CharArray.asList(): List<Char> {
|
||||
return object : AbstractList<Char>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Char)
|
||||
override fun iterator(): MutableIterator<Char> = this@asList.iterator() as MutableIterator<Char>
|
||||
@@ -10493,7 +10493,7 @@ public fun CharArray.asList(): List<Char> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun DoubleArray.asList(): List<Double> {
|
||||
return object : AbstractList<Double>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Double)
|
||||
override fun iterator(): MutableIterator<Double> = this@asList.iterator() as MutableIterator<Double>
|
||||
@@ -10509,7 +10509,7 @@ public fun DoubleArray.asList(): List<Double> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun FloatArray.asList(): List<Float> {
|
||||
return object : AbstractList<Float>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Float)
|
||||
override fun iterator(): MutableIterator<Float> = this@asList.iterator() as MutableIterator<Float>
|
||||
@@ -10525,7 +10525,7 @@ public fun FloatArray.asList(): List<Float> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun IntArray.asList(): List<Int> {
|
||||
return object : AbstractList<Int>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Int)
|
||||
override fun iterator(): MutableIterator<Int> = this@asList.iterator() as MutableIterator<Int>
|
||||
@@ -10541,7 +10541,7 @@ public fun IntArray.asList(): List<Int> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun LongArray.asList(): List<Long> {
|
||||
return object : AbstractList<Long>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Long)
|
||||
override fun iterator(): MutableIterator<Long> = this@asList.iterator() as MutableIterator<Long>
|
||||
@@ -10557,7 +10557,7 @@ public fun LongArray.asList(): List<Long> {
|
||||
@kotlin.jvm.JvmVersion
|
||||
public fun ShortArray.asList(): List<Short> {
|
||||
return object : AbstractList<Short>(), RandomAccess {
|
||||
override fun size(): Int = this@asList.size()
|
||||
override val size: Int get() = this@asList.size()
|
||||
override fun isEmpty(): Boolean = this@asList.isEmpty()
|
||||
override fun contains(o: Any?): Boolean = this@asList.contains(o as Short)
|
||||
override fun iterator(): MutableIterator<Short> = this@asList.iterator() as MutableIterator<Short>
|
||||
|
||||
@@ -20,7 +20,7 @@ internal object EmptyList : List<Nothing>, Serializable {
|
||||
override fun hashCode(): Int = 1
|
||||
override fun toString(): String = "[]"
|
||||
|
||||
override fun size(): Int = 0
|
||||
override val size: Int get() = 0
|
||||
override fun isEmpty(): Boolean = true
|
||||
override fun contains(o: Any?): Boolean = false
|
||||
override fun containsAll(c: Collection<Any?>): Boolean = c.isEmpty()
|
||||
|
||||
@@ -65,7 +65,7 @@ private class MapWithDefaultImpl<K, out V>(public override val map: Map<K,V>, pr
|
||||
override fun equals(other: Any?): Boolean = map.equals(other)
|
||||
override fun hashCode(): Int = map.hashCode()
|
||||
override fun toString(): String = map.toString()
|
||||
override fun size(): Int = map.size()
|
||||
override val size: Int get() = map.size()
|
||||
override fun isEmpty(): Boolean = map.isEmpty()
|
||||
override fun containsKey(key: Any?): Boolean = map.containsKey(key)
|
||||
override fun containsValue(value: Any?): Boolean = map.containsValue(value)
|
||||
@@ -81,7 +81,7 @@ private class MutableMapWithDefaultImpl<K, V>(public override val map: MutableMa
|
||||
override fun equals(other: Any?): Boolean = map.equals(other)
|
||||
override fun hashCode(): Int = map.hashCode()
|
||||
override fun toString(): String = map.toString()
|
||||
override fun size(): Int = map.size()
|
||||
override val size: Int get() = map.size()
|
||||
override fun isEmpty(): Boolean = map.isEmpty()
|
||||
override fun containsKey(key: Any?): Boolean = map.containsKey(key)
|
||||
override fun containsValue(value: Any?): Boolean = map.containsValue(value)
|
||||
|
||||
@@ -11,7 +11,7 @@ private object EmptyMap : Map<Any, Nothing>, Serializable {
|
||||
override fun hashCode(): Int = 0
|
||||
override fun toString(): String = "{}"
|
||||
|
||||
override fun size(): Int = 0
|
||||
override val size: Int get() = 0
|
||||
override fun isEmpty(): Boolean = true
|
||||
|
||||
override fun containsKey(key: Any?): Boolean = false
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.AbstractList
|
||||
import kotlin.platform.platformName
|
||||
|
||||
private open class ReversedListReadOnly<T>(protected open val delegate: List<T>) : AbstractList<T>() {
|
||||
override fun size(): Int = delegate.size()
|
||||
override val size: Int get() = delegate.size()
|
||||
override fun get(index: Int): T = delegate[index.flipIndex()]
|
||||
|
||||
protected fun Int.flipIndex(): Int = if (this in 0..size() - 1) size() - this - 1 else throw IndexOutOfBoundsException("index $this should be in range [${0..size() - 1}]")
|
||||
|
||||
@@ -12,7 +12,7 @@ internal object EmptySet : Set<Nothing>, Serializable {
|
||||
override fun hashCode(): Int = 0
|
||||
override fun toString(): String = "[]"
|
||||
|
||||
override fun size(): Int = 0
|
||||
override val size: Int get() = 0
|
||||
override fun isEmpty(): Boolean = true
|
||||
override fun contains(o: Any?): Boolean = false
|
||||
override fun containsAll(c: Collection<Any?>): Boolean = c.isEmpty()
|
||||
|
||||
@@ -211,7 +211,7 @@ public fun Node.removeFromParent() {
|
||||
}
|
||||
|
||||
private class NodeListAsList(private val delegate: NodeList) : AbstractList<Node>() {
|
||||
override fun size(): Int = delegate.length
|
||||
override val size: Int get() = delegate.length
|
||||
|
||||
override fun get(index: Int): Node = when {
|
||||
index in 0..size() - 1 -> delegate.item(index)!!
|
||||
@@ -231,7 +231,7 @@ private class ElementListAsList(private val nodeList: NodeList) : AbstractList<E
|
||||
}
|
||||
}
|
||||
|
||||
override fun size(): Int = nodeList.length
|
||||
override val size: Int get() = nodeList.length
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ private class MatcherMatchResult(private val matcher: Matcher, private val input
|
||||
get() = matchResult.group()
|
||||
|
||||
override val groups: MatchGroupCollection = object : MatchGroupCollection {
|
||||
override fun size(): Int = matchResult.groupCount() + 1
|
||||
override val size: Int get() = matchResult.groupCount() + 1
|
||||
override fun isEmpty(): Boolean = false
|
||||
override fun contains(o: Any?): Boolean = o is MatchGroup? && this.any({ it == o })
|
||||
override fun containsAll(c: Collection<Any?>): Boolean = c.all({contains(it)})
|
||||
|
||||
Reference in New Issue
Block a user