Extensions

open class Extensions

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun <T> arrayList(n: Int): List<T>
Create a 1D array (using an ArrayList).
open fun <T> arrayList(x: Int, y: Int): List<List<T>>
Create a 2D array (using ArrayLists).
open fun <T> arrayList(x: Int, y: Int, z: Int): List<List<List<T>>>
Create a 3D array (using ArrayLists).
Link copied to clipboard
open fun arrayOf(items: Array<Boolean>): Array<Boolean>
Link copied to clipboard
open fun charArrayOf(items: Array<Char>): Array<Char>
Link copied to clipboard
open fun dir(dir: File): List<File>
Link copied to clipboard
open fun doubleArrayOf(items: Array<Double>): Array<Double>
Link copied to clipboard
open fun downTo(start: Char, endInclusive: Char): CharProgression
open fun downTo(start: Int, endInclusive: Int): IntProgression
open fun downTo(start: Long, endInclusive: Long): LongProgression
Link copied to clipboard
open fun extension(file: File): String
Link copied to clipboard
open fun floatArrayOf(items: Array<Float>): Array<Float>
Link copied to clipboard
open fun homeDirectory(): File
Link copied to clipboard
open fun <T> indices(list: Array<T>): IntRange
open fun indices(list: Array<Boolean>): IntRange
open fun indices(list: Array<Byte>): IntRange
open fun indices(list: Array<Char>): IntRange
open fun indices(list: Array<Double>): IntRange
open fun indices(list: Array<Float>): IntRange
open fun indices(list: Array<Int>): IntRange
open fun indices(list: Array<Long>): IntRange
open fun indices(list: Array<Short>): IntRange

open fun indices(list: List<out Any>): IntRange
This is useful if you wish to iterate over the index values of a list.
Link copied to clipboard
open fun intArrayOf(items: Array<Int>): Array<Int>
Link copied to clipboard
open fun isAlphabetic(c: Char): Boolean
Link copied to clipboard
open fun isDigit(c: Char): Boolean
Link copied to clipboard
open fun isLetter(c: Char): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isLowerCase(c: Char): Boolean
Link copied to clipboard
open fun isSpaceChar(c: Char): Boolean
Link copied to clipboard
open fun isUpperCase(c: Char): Boolean
Link copied to clipboard
open fun isWhitespace(c: Char): Boolean
This is DIFFERENT from Java's Character.isWhiteSpace.
Link copied to clipboard
Allows for loops to iterate over CharSequences.
Link copied to clipboard
open fun <T> listOf(items: Array<T>): List<T>
Creates a mutable List containing the items specified.
Link copied to clipboard
open fun longArrayOf(items: Array<Long>): Array<Long>
Link copied to clipboard
open fun <K, V> mapOf(entries: Array<Duo<K, V>>): Map<K, V>
Creates a mutable Map containing the items specified.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun rangeTo(start: Char, endInclusive: Char): CharRange
open fun rangeTo(start: Int, endInclusive: Int): IntRange
open fun rangeTo(start: Long, endInclusive: Long): LongRange
Link copied to clipboard
Link copied to clipboard
open fun readText(file: File): String
open fun readText(file: File, charset: Charset): String
Link copied to clipboard
open fun <T> reversed(list: List<T>): List<T>
Creates a new list, with the items in reverse order.
Link copied to clipboard
open fun <T> setOf(items: Array<T>): Set<T>
Creates a mutable Set containing the items specified.
Link copied to clipboard
open fun shortArrayOf(items: Array<Short>): Array<Short>
Link copied to clipboard
open fun splitLines(str: String): List<String>
Link copied to clipboard
open fun splitTerminator(str: String, regex: String): List<String>
Link copied to clipboard
open fun times(c: Char, times: Int): String
open fun times(str: String, times: Int): String
Link copied to clipboard
open fun <K, V> to(key: K, value: V): Duo<K, V>
Use as an infix function within a call to mapOf.
open fun to(start: Char, endInclusive: Char): CharProgression
Creates a CharRange from start to endInclusive if endInclusive >= start, otherwise it creates a downwards CharProgression (with step -1).
open fun to(start: Int, endInclusive: Int): IntProgression
Creates an IntRange from start to endInclusive if endInclusive >= start, otherwise it creates a downwards IntProgression (with step -1).
open fun to(start: Long, endInclusive: Long): LongProgression
Creates a LongRange from start to endInclusive if endInclusive >= start, otherwise it creates a downwards LongProgression (with step -1).
Link copied to clipboard
open fun <T> toArray(collection: Collection<T>): Array<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun toDouble(str: String): Double
open fun toDouble(str: String, defaultValue: Double): Double
Link copied to clipboard
Link copied to clipboard
open fun toFloat(str: String): Float
open fun toFloat(str: String, defaultValue: Float): Float
Link copied to clipboard
Link copied to clipboard
open fun toInt(value: Double): Int
open fun toInt(value: Float): Int
open fun toInt(str: String): Int
open fun toInt(str: String, defaultValue: Int): Int
Link copied to clipboard
Link copied to clipboard
open fun <T> toList(array: Array<T>): List<T>
Returns a copy of the array as a list.
open fun toList(array: Array<Int>): List<Integer>
open fun <T> toList(collection: Collection<T>): List<T>
Link copied to clipboard
open fun toLong(value: Double): Long
open fun toLong(value: Float): Long
open fun toLong(str: String): Long
open fun toLong(str: String, defaultValue: Long): Long
Link copied to clipboard
open fun toLongArray(list: Collection<Long>): Array<Long>
Link copied to clipboard
open fun toLowerCase(c: Char): Char
Link copied to clipboard
open fun <T> toSet(collection: Collection<T>): Set<T>
Link copied to clipboard
Link copied to clipboard
open fun toString(c: Char): String
Link copied to clipboard
open fun toUpperCase(c: Char): Char
Link copied to clipboard
open fun until(start: Char, endExclusive: Char): CharRange
open fun until(start: Int, endExclusive: Int): IntRange
open fun until(start: Long, endExclusive: Long): LongRange
Link copied to clipboard
open fun writeText(file: File, str: String)
open fun writeText(file: File, str: String, charset: Charset)