Make Array.size() a function instead of a property

Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
This commit is contained in:
Alexander Udalov
2014-11-14 18:02:04 +03:00
parent bc238d5f4c
commit 128c938965
67 changed files with 677 additions and 625 deletions
+3 -1
View File
@@ -16,10 +16,12 @@
package kotlin
public class Array<reified T>(public val size: Int, init: (Int) -> T) : Cloneable {
public class Array<reified T>(size: Int, init: (Int) -> T) : Cloneable {
public fun get(index: Int): T
public fun set(index: Int, value: T): Unit
public fun size(): Int
public fun iterator(): Iterator<T>
public val indices: IntRange
+24 -8
View File
@@ -18,10 +18,12 @@
package kotlin
public class ByteArray(public val size: Int) : Cloneable {
public class ByteArray(size: Int) : Cloneable {
public fun get(index: Int): Byte
public fun set(index: Int, value: Byte): Unit
public fun size(): Int
public fun iterator(): ByteIterator
public val indices: IntRange
@@ -29,10 +31,12 @@ public class ByteArray(public val size: Int) : Cloneable {
public override fun clone(): ByteArray
}
public class CharArray(public val size: Int) : Cloneable {
public class CharArray(size: Int) : Cloneable {
public fun get(index: Int): Char
public fun set(index: Int, value: Char): Unit
public fun size(): Int
public fun iterator(): CharIterator
public val indices: IntRange
@@ -40,10 +44,12 @@ public class CharArray(public val size: Int) : Cloneable {
public override fun clone(): CharArray
}
public class ShortArray(public val size: Int) : Cloneable {
public class ShortArray(size: Int) : Cloneable {
public fun get(index: Int): Short
public fun set(index: Int, value: Short): Unit
public fun size(): Int
public fun iterator(): ShortIterator
public val indices: IntRange
@@ -51,10 +57,12 @@ public class ShortArray(public val size: Int) : Cloneable {
public override fun clone(): ShortArray
}
public class IntArray(public val size: Int) : Cloneable {
public class IntArray(size: Int) : Cloneable {
public fun get(index: Int): Int
public fun set(index: Int, value: Int): Unit
public fun size(): Int
public fun iterator(): IntIterator
public val indices: IntRange
@@ -62,10 +70,12 @@ public class IntArray(public val size: Int) : Cloneable {
public override fun clone(): IntArray
}
public class LongArray(public val size: Int) : Cloneable {
public class LongArray(size: Int) : Cloneable {
public fun get(index: Int): Long
public fun set(index: Int, value: Long): Unit
public fun size(): Int
public fun iterator(): LongIterator
public val indices: IntRange
@@ -73,10 +83,12 @@ public class LongArray(public val size: Int) : Cloneable {
public override fun clone(): LongArray
}
public class FloatArray(public val size: Int) : Cloneable {
public class FloatArray(size: Int) : Cloneable {
public fun get(index: Int): Float
public fun set(index: Int, value: Float): Unit
public fun size(): Int
public fun iterator(): FloatIterator
public val indices: IntRange
@@ -84,10 +96,12 @@ public class FloatArray(public val size: Int) : Cloneable {
public override fun clone(): FloatArray
}
public class DoubleArray(public val size: Int) : Cloneable {
public class DoubleArray(size: Int) : Cloneable {
public fun get(index: Int): Double
public fun set(index: Int, value: Double): Unit
public fun size(): Int
public fun iterator(): DoubleIterator
public val indices: IntRange
@@ -95,10 +109,12 @@ public class DoubleArray(public val size: Int) : Cloneable {
public override fun clone(): DoubleArray
}
public class BooleanArray(public val size: Int) : Cloneable {
public class BooleanArray(size: Int) : Cloneable {
public fun get(index: Int): Boolean
public fun set(index: Int, value: Boolean): Unit
public fun size(): Int
public fun iterator(): BooleanIterator
public val indices: IntRange