Update standard library to 1.3 (#1915)

* Add Char.MIN_VALUE and Char.MAX_VALUE constants

* Add Boolean companion object

* Add SIZE_BYTES and SIZE_BITS
This commit is contained in:
Sergey Bogolepov
2018-08-22 12:30:38 +03:00
committed by GitHub
parent c5c66f0fc9
commit 326568bf8f
3 changed files with 75 additions and 0 deletions
@@ -21,6 +21,10 @@ package kotlin
* represented as values of the primitive type `boolean`.
*/
public final class Boolean private constructor(private val value: kotlin.native.internal.BooleanValue) : Comparable<Boolean> {
@SinceKotlin("1.3")
companion object {}
/**
* Returns the inverse of this boolean.
*/
+23
View File
@@ -76,6 +76,29 @@ public final class Char private constructor(private val value: kotlin.native.int
external public fun toDouble(): Double
companion object {
/**
* The minimum value of a character code unit.
*/
@SinceKotlin("1.3")
public const val MIN_VALUE: Char = '\u0000'
/**
* The maximum value of a character code unit.
*/
@SinceKotlin("1.3")
public const val MAX_VALUE: Char = '\uFFFF'
/**
* The number of bytes used to represent a Char in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BYTES: Int = 2
/**
* The number of bits used to represent a Char in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BITS: Int = 16
/**
* The minimum value of a Unicode high-surrogate code unit.
*/
@@ -33,6 +33,18 @@ public final class Byte private constructor(private val value: kotlin.native.int
* A constant holding the maximum value an instance of Byte can have.
*/
public const val MAX_VALUE: Byte = 127
/**
* The number of bytes used to represent an instance of Byte in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BYTES: Int = 1
/**
* The number of bits used to represent an instance of Byte in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BITS: Int = 8
}
/**
@@ -247,6 +259,18 @@ public final class Short private constructor(private val value: kotlin.native.in
* A constant holding the maximum value an instance of Short can have.
*/
public const val MAX_VALUE: Short = 32767
/**
* The number of bytes used to represent an instance of Short in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BYTES: Int = 2
/**
* The number of bits used to represent an instance of Short in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BITS: Int = 16
}
/**
@@ -461,6 +485,18 @@ public final class Int private constructor(private val value: kotlin.native.inte
* A constant holding the maximum value an instance of Int can have.
*/
public const val MAX_VALUE: Int = 2147483647
/**
* The number of bytes used to represent an instance of Int in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BYTES: Int = 4
/**
* The number of bits used to represent an instance of Int in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BITS: Int = 32
}
/**
@@ -697,6 +733,18 @@ public final class Long private constructor(private val value: kotlin.native.int
* A constant holding the maximum value an instance of Long can have.
*/
public const val MAX_VALUE: Long = 9223372036854775807L
/**
* The number of bytes used to represent an instance of Long in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BYTES: Int = 8
/**
* The number of bits used to represent an instance of Long in a binary form.
*/
@SinceKotlin("1.3")
public const val SIZE_BITS: Int = 64
}
/**