Core functions and types, available on all supported platforms.
interface Annotation Base interface implicitly implemented by all annotation interfaces. See Kotlin language documentation for more information on annotations. | |
open class Any The root of the Kotlin class hierarchy. Every Kotlin class has Any as a superclass. | |
class Array<T> Represents an array (specifically, a Java array when targeting the JVM platform). Array instances can be created using the arrayOf, arrayOfNulls and emptyArray standard library functions. See Kotlin language documentation for more information on arrays. | |
open class AssertionError : Error | |
class Boolean : Comparable<Boolean> Represents a value which is either | |
class BooleanArray An array of booleans. When targeting the JVM, instances of this class are represented as | |
class Byte : Number, Comparable<Byte> Represents a 8-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class ByteArray An array of bytes. When targeting the JVM, instances of this class are represented as | |
class Char : Comparable<Char> Represents a 16-bit Unicode character. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class CharArray An array of chars. When targeting the JVM, instances of this class are represented as | |
interface CharSequence Represents a readable sequence of Char values. | |
open class ClassCastException : RuntimeException | |
interface Comparable<in T> Classes which inherit from this interface have a defined total ordering between their instances. | |
interface Comparator<T> | |
open class ConcurrentModificationException : RuntimeException | |
enum class DeprecationLevel Contains levels for deprecation levels. | |
class Double : Number, Comparable<Double> Represents a double-precision 64-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class DoubleArray An array of doubles. When targeting the JVM, instances of this class are represented as | |
abstract class Enum<E : Enum<E>> : Comparable<E> The common base class of all enum classes. See the Kotlin language documentation for more information on enum classes. | |
open class Error : Throwable | |
open class Exception : Throwable | |
class Float : Number, Comparable<Float> Represents a single-precision 32-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class FloatArray An array of floats. When targeting the JVM, instances of this class are represented as | |
interface Function<out R> Represents a value of a functional type, such as a lambda, an anonymous function or a function reference. | |
open class IllegalArgumentException : RuntimeException | |
open class IllegalStateException : RuntimeException | |
open class IndexOutOfBoundsException : RuntimeException | |
class Int : Number, Comparable<Int> Represents a 32-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class IntArray An array of ints. When targeting the JVM, instances of this class are represented as | |
class KotlinVersion : Comparable<KotlinVersion> Represents a version of the Kotlin standard library. | |
interface Lazy<out T> Represents a value with lazy initialization. | |
enum class LazyThreadSafetyMode Specifies how a Lazy instance synchronizes initialization among multiple threads. | |
class Long : Number, Comparable<Long> Represents a 64-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class LongArray An array of longs. When targeting the JVM, instances of this class are represented as | |
open class NoSuchElementException : RuntimeException | |
open class NoWhenBranchMatchedException : RuntimeException | |
class Nothing Nothing has no instances. You can use Nothing to represent "a value that never exists": for example, if a function has the return type of Nothing, it means that it never returns (always throws an exception). | |
open class NullPointerException : RuntimeException | |
abstract class Number Superclass for all platform classes representing numeric values. | |
open class NumberFormatException : IllegalArgumentException | |
data class Pair<out A, out B> : Serializable Represents a generic pair of two values. | |
open class RuntimeException : Exception | |
class Short : Number, Comparable<Short> Represents a 16-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type | |
class ShortArray An array of shorts. When targeting the JVM, instances of this class are represented as | |
class String : Comparable<String>, CharSequence The | |
open class Throwable The base class for all errors and exceptions. Only instances of this class can be thrown or caught. | |
data class Triple<out A, out B, out C> : Serializable Represents a triad of values | |
open class UninitializedPropertyAccessException : RuntimeException | |
object Unit The type with only one value: the Unit object. This type corresponds to the | |
open class UnsupportedOperationException : RuntimeException |
annotation class Deprecated Marks the annotated class, function, property, variable or parameter as deprecated. | |
annotation class DslMarker When applied to annotation class X specifies that X defines a DSL language | |
annotation class ExtensionFunctionType Signifies that the annotated functional type represents an extension function. | |
annotation class ParameterName Annotates type arguments of functional type and holds corresponding parameter name specified by the user in type declaration (if any). | |
annotation class PublishedApi When applied to a class or a member with internal visibility allows to use it from public inline functions and makes it effectively public. | |
annotation class ReplaceWith Specifies a code fragment that can be used to replace a deprecated function, property or class. Tools such as IDEs can automatically apply the replacements specified through this annotation. | |
annotation class SinceKotlin Specifies the first version of Kotlin where a declaration has appeared. Using the declaration and specifying an older API version (via the | |
annotation class Suppress Suppresses the given compilation warnings in the annotated element. | |
annotation class UnsafeVariance Suppresses errors about variance conflict |
class NotImplementedError : Error An exception is thrown to indicate that a method body remains to be implemented. |
typealias AssertionError = AssertionError | |
typealias ClassCastException = ClassCastException | |
typealias Comparator<T> = Comparator<T> | |
typealias Error = Error | |
typealias Exception = Exception | |
typealias IllegalArgumentException = IllegalArgumentException | |
typealias IllegalStateException = IllegalStateException | |
typealias IndexOutOfBoundsException = IndexOutOfBoundsException | |
typealias NoSuchElementException = NoSuchElementException | |
typealias NullPointerException = NullPointerException | |
typealias NumberFormatException = NumberFormatException | |
typealias RuntimeException = RuntimeException | |
typealias Synchronized = Synchronized | |
typealias UnsupportedOperationException = UnsupportedOperationException | |
typealias Volatile = Volatile |
val KProperty0<*>.isInitialized: Boolean Returns | |
val Throwable.stackTrace: Array<StackTraceElement> Returns an array of stack trace elements representing the stack trace pertaining to this throwable. |
fun <T> Comparator( comparison: (a: T, b: T) -> Int ): Comparator<T> | |
fun TODO(): Nothing fun TODO(reason: String): Nothing Always throws NotImplementedError stating that operation is not implemented. | |
fun Throwable.addSuppressed(exception: Throwable) When supported by the platform adds the specified exception to the list of exceptions that were suppressed in order to deliver this exception. | |
fun <T> T.also(block: (T) -> Unit): T Calls the specified function block with | |
fun <T> T.apply(block: T.() -> Unit): T Calls the specified function block with | |
fun <T> arrayOf(vararg elements: T): Array<T> Returns an array containing the specified elements. | |
fun <T> arrayOfNulls(size: Int): Array<T?> Returns an array of objects of the given type with the given size, initialized with null values. | |
fun assert(value: Boolean) Throws an AssertionError if the value is false and runtime assertions have been enabled on the JVM using the -ea JVM option. fun assert(value: Boolean, lazyMessage: () -> Any) Throws an AssertionError calculated by lazyMessage if the value is false and runtime assertions have been enabled on the JVM using the -ea JVM option. | |
fun booleanArrayOf(vararg elements: Boolean): BooleanArray Returns an array containing the specified boolean values. | |
fun byteArrayOf(vararg elements: Byte): ByteArray Returns an array containing the specified Byte numbers. | |
fun charArrayOf(vararg elements: Char): CharArray Returns an array containing the specified characters. | |
fun check(value: Boolean) Throws an IllegalStateException if the value is false. fun check(value: Boolean, lazyMessage: () -> Any) Throws an IllegalStateException with the result of calling lazyMessage if the value is false. | |
fun <T : Any> checkNotNull(value: T?): T Throws an IllegalStateException if the value is null. Otherwise returns the not null value. fun <T : Any> checkNotNull( value: T?, lazyMessage: () -> Any ): T Throws an IllegalStateException with the result of calling lazyMessage if the value is null. Otherwise returns the not null value. | |
fun doubleArrayOf(vararg elements: Double): DoubleArray Returns an array containing the specified Double numbers. | |
fun <T> emptyArray(): Array<T> Returns an empty array of the specified type T. | |
fun <T : Enum<T>> enumValueOf(name: String): T Returns an enum entry with specified name. | |
fun <T : Enum<T>> enumValues(): Array<T> Returns an array containing enum T entries. | |
fun error(message: Any): Nothing Throws an IllegalStateException with the given message. | |
fun floatArrayOf(vararg elements: Float): FloatArray Returns an array containing the specified Float numbers. | |
operator fun <T> Lazy<T>.getValue( thisRef: Any?, property: KProperty<*> ): T An extension to delegate a read-only property of type T to an instance of Lazy. | |
fun intArrayOf(vararg elements: Int): IntArray Returns an array containing the specified Int numbers. | |
fun Double.isFinite(): Boolean fun Float.isFinite(): Boolean Returns | |
fun Double.isInfinite(): Boolean fun Float.isInfinite(): Boolean Returns | |
fun Double.isNaN(): Boolean fun Float.isNaN(): Boolean Returns | |
fun <T> lazy(initializer: () -> T): Lazy<T> fun <T> lazy(lock: Any?, initializer: () -> T): Lazy<T> Creates a new instance of the Lazy that uses the specified initialization function initializer and the default thread-safety mode LazyThreadSafetyMode.SYNCHRONIZED. fun <T> lazy( mode: LazyThreadSafetyMode, initializer: () -> T ): Lazy<T> Creates a new instance of the Lazy that uses the specified initialization function initializer and thread-safety mode. | |
fun <T> lazyOf(value: T): Lazy<T> Creates a new instance of the Lazy that is already initialized with the specified value. | |
fun <T, R> T.let(block: (T) -> R): R Calls the specified function block with | |
fun longArrayOf(vararg elements: Long): LongArray Returns an array containing the specified Long numbers. | |
operator fun String?.plus(other: Any?): String Concatenates this string with the string representation of the given other object. If either the receiver or the other object are null, they are represented as the string "null". | |
fun Throwable.printStackTrace() Prints the stack trace of this throwable to the standard output. fun Throwable.printStackTrace(writer: PrintWriter) Prints the stack trace of this throwable to the specified writer. fun Throwable.printStackTrace(stream: PrintStream) Prints the stack trace of this throwable to the specified stream. | |
fun repeat(times: Int, action: (Int) -> Unit) Executes the given function action specified number of times. | |
fun require(value: Boolean) Throws an IllegalArgumentException if the value is false. fun require(value: Boolean, lazyMessage: () -> Any) Throws an IllegalArgumentException with the result of calling lazyMessage if the value is false. | |
fun <T : Any> requireNotNull(value: T?): T Throws an IllegalArgumentException if the value is null. Otherwise returns the not null value. fun <T : Any> requireNotNull( value: T?, lazyMessage: () -> Any ): T Throws an IllegalArgumentException with the result of calling lazyMessage if the value is null. Otherwise returns the not null value. | |
fun <R> run(block: () -> R): R Calls the specified function block and returns its result. fun <T, R> T.run(block: T.() -> R): R Calls the specified function block with | |
fun shortArrayOf(vararg elements: Short): ShortArray Returns an array containing the specified Short numbers. | |
fun <R> suspend(block: suspend () -> R): suspend () -> R | |
fun <R> synchronized(lock: Any, block: () -> R): R Executes the given function block while holding the monitor of the given object lock. | |
fun <T> T.takeIf(predicate: (T) -> Boolean): T? Returns | |
fun <T> T.takeUnless(predicate: (T) -> Boolean): T? Returns | |
infix fun <A, B> A.to(that: B): Pair<A, B> | |
fun Int.toBigDecimal(): BigDecimal fun Int.toBigDecimal(mathContext: MathContext): BigDecimal Returns the value of this Int number as a BigDecimal. fun Long.toBigDecimal(): BigDecimal fun Long.toBigDecimal(mathContext: MathContext): BigDecimal Returns the value of this Long number as a BigDecimal. fun Float.toBigDecimal(): BigDecimal fun Float.toBigDecimal(mathContext: MathContext): BigDecimal Returns the value of this Float number as a BigDecimal. fun Double.toBigDecimal(): BigDecimal fun Double.toBigDecimal(mathContext: MathContext): BigDecimal Returns the value of this Double number as a BigDecimal. | |
fun Int.toBigInteger(): BigInteger Returns the value of this Int number as a BigInteger. fun Long.toBigInteger(): BigInteger Returns the value of this Long number as a BigInteger. | |
fun Double.toBits(): Long Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout. fun Float.toBits(): Int Returns a bit representation of the specified floating-point value as Int according to the IEEE 754 floating-point "single format" bit layout. | |
fun <T> Pair<T, T>.toList(): List<T> Converts this pair into a list. fun <T> Triple<T, T, T>.toList(): List<T> Converts this triple into a list. | |
fun Double.toRawBits(): Long Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout, preserving fun Float.toRawBits(): Int Returns a bit representation of the specified floating-point value as Int according to the IEEE 754 floating-point "single format" bit layout, preserving | |
fun Any?.toString(): String Returns a string representation of the object. Can be called with a null receiver, in which case it returns the string "null". | |
fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R Executes the given block function on this resource and then closes it down correctly whether an exception is thrown or not. | |
fun <T, R> with(receiver: T, block: T.() -> R): R Calls the specified function block with the given receiver as its receiver and returns its result. |
fun Double.Companion.fromBits(bits: Long): Double Returns the Double value corresponding to a given bit representation. fun Float.Companion.fromBits(bits: Int): Float Returns the Float value corresponding to a given bit representation. |
© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/index.html