Package-level declarations

Types

Link copied to clipboard
internal open class ColumnDataCollector(initCapacity: Int = 0, val typeOf: (KClass<*>) -> KType) : DataCollectorBase<Any?>
Link copied to clipboard
class ColumnNameGenerator(columnNames: List<String> = emptyList())
Link copied to clipboard
internal class Counts(val value: Any?, val count: Int)
Link copied to clipboard
interface DataCollector<T>
Link copied to clipboard
internal abstract class DataCollectorBase<T>(initCapacity: Int) : DataCollector<T>
Link copied to clipboard
internal open class DataFrameImpl<T>(cols: List<AnyCol>, val nrow: Int) : DataFrame<T> , AggregatableInternal<T>
Link copied to clipboard
internal open class DataFrameReceiver<T>(source: DataFrame<T>, unresolvedColumnsPolicy: UnresolvedColumnsPolicy) : DataFrameReceiverBase<T> , SingleColumn<DataRow<T>>
Link copied to clipboard
internal abstract class DataFrameReceiverBase<T>(val df: DataFrame<T>) : DataFrameImpl<T>
Link copied to clipboard
data class DataFrameSize(val ncol: Int, val nrow: Int)
Link copied to clipboard
internal open class DataRowImpl<T>(index: Int, df: DataFrame<T>) : DataRow<T>
Link copied to clipboard
internal class DirectedAcyclicGraph<T>

Represents a directed acyclic graph (DAG) of generic type T.

Link copied to clipboard
internal class GroupByImpl<T, G>(val df: DataFrame<T>, val groups: FrameColumn<G>, val keyColumnsInGroups: ColumnsSelector<G, *>) : GroupBy<T, G> , AggregatableInternal<G>
Link copied to clipboard
internal class Info(val df: AnyFrame)
Link copied to clipboard
internal typealias IsBetterThan<C> = C.(other: C) -> Boolean

Type alias for a function representing a reduction over a sequence of values trying to find the "best" value.

Link copied to clipboard
internal class LazyMap<K, out V>(actualMap: Map<K, Lazy<V>>) : Map<K, V>

Map that resolves values lazily.

Link copied to clipboard
internal class TypedColumnDataCollector<T>(initCapacity: Int = 0, val type: KType, val checkTypes: Boolean = true) : DataCollectorBase<T?>
Link copied to clipboard
internal data class UnifiedNumberTypeOptions(val useBigNumbers: Boolean, val allowLongToDoubleConversion: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard
internal val KType.canBeNaN: Boolean
Link copied to clipboard

Returns the column name for this callable. If the callable contains the ColumnName annotation, its ColumnName.name is returned. Otherwise, the name of the callable is returned with proper getter-trimming if it's a KFunction.

Link copied to clipboard
internal val KCallable<*>.getterName: String
internal val KFunction<*>.getterName: String
internal val KProperty<*>.getterName: String

Returns the getter name for this callable. The name of the callable is returned with proper getter-trimming if it's a KFunction.

Link copied to clipboard
internal val Any.isArray: Boolean

Returns true if this object is an array, either a primitive array like XArray or Array<>.

internal val KClass<*>.isArray: Boolean

Returns true if this class is an array, either a primitive array like XArray or Array<>.

internal val KType.isArray: Boolean

Returns true if this type is of an array, either a primitive array like XArray or Array<>.

Link copied to clipboard
internal val KClass<*>.isJavaRecord: Boolean

Returns true if this class is a Java record.

Link copied to clipboard
internal val KType.isNothing: Boolean
Link copied to clipboard

Returns true if this object is a primitive array like XArray.

Returns true if this class is a primitive array class like XArray.

Returns true if this type is of a primitive array like XArray.

Link copied to clipboard
internal val nothingType: KType
Link copied to clipboard
Link copied to clipboard
internal val <T> DataRow<T>.owner: DataFrame<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal const val UNNAMED_COLUMN_PREFIX: String

Functions

Link copied to clipboard
internal fun <T, G, R> aggregateGroupBy(df: DataFrame<T>, selector: ColumnSelector<T, DataFrame<G>?>, removeColumns: Boolean, body: AggregateGroupedBody<G, R>): DataFrame<T>
Link copied to clipboard
internal infix fun <T> Predicate<T>?.and(other: Predicate<T>): Predicate<T>
Link copied to clipboard
internal fun <T> Iterable<T>.anyNull(): Boolean
Link copied to clipboard
internal fun Any.asArrayAsListOrNull(): List<*>?

If this is an array of any kind, the function returns it as a list of values, else it returns null.

Link copied to clipboard
fun <T> Iterable<T>.asList(): List<T>
Link copied to clipboard
internal fun <T> T.asNullable(): T?
Link copied to clipboard
internal inline fun <C> Sequence<C>.bestBy(isBetterThan: IsBetterThan<C>): C
Link copied to clipboard
internal inline fun <C : R, R> Sequence<C>.bestByOrElse(isBetterThan: IsBetterThan<C>, ifEmpty: () -> R): R
Link copied to clipboard
internal inline fun <C> Sequence<C>.bestByOrNull(isBetterThan: IsBetterThan<C>): C?
Link copied to clipboard
internal inline fun <C : Any> Sequence<C?>.bestNotNaBy(isBetterThan: IsBetterThan<C>): C
Link copied to clipboard
internal inline fun <C : R, R> Sequence<C?>.bestNotNaByOrElse(isBetterThan: IsBetterThan<C & Any>, ifEmptyOrAllNa: () -> R): R
Link copied to clipboard
internal inline fun <C : Any> Sequence<C?>.bestNotNaByOrNull(isBetterThan: IsBetterThan<C>): C?
Link copied to clipboard
internal inline fun <C : Any> Sequence<C?>.bestNotNullBy(isBetterThan: IsBetterThan<C>): C
Link copied to clipboard
internal inline fun <C : R, R> Sequence<C?>.bestNotNullByOrElse(isBetterThan: IsBetterThan<C & Any>, ifEmptyOrAllNull: () -> R): R
Link copied to clipboard
internal inline fun <C : Any> Sequence<C?>.bestNotNullByOrNull(isBetterThan: IsBetterThan<C>): C?
Link copied to clipboard
internal fun <T : Comparable<T>> T.between(left: T, right: T, includeBoundaries: Boolean = true): Boolean
Link copied to clipboard

Builds a new DirectedAcyclicGraph using the provided builder function.

Link copied to clipboard
internal inline fun <reified T : Any> Int.cast(): T
Link copied to clipboard
internal fun <T> catchSilent(body: () -> T): T?
Link copied to clipboard
internal fun Iterable<Any?>.classes(): Set<KClass<*>>

Returns a set containing the KClass of each element in the iterable.

Link copied to clipboard
internal fun commonParent(classes: Iterable<KClass<*>>): KClass<*>?
internal fun commonParent(vararg classes: KClass<*>): KClass<*>?
Link copied to clipboard
internal fun commonParents(classes: Iterable<KClass<*>>): List<KClass<*>>
internal fun commonParents(vararg classes: KClass<*>): List<KClass<*>>
Link copied to clipboard
@JvmName(name = "commonTypeOverload")
internal fun commonType(types: Iterable<KType?>, useStar: Boolean = true): KType
Link copied to clipboard
internal fun Iterable<KType?>.commonType(useStar: Boolean = true): KType

Returns the common supertype of the given types.

internal fun Iterable<KClass<*>>.commonType(nullable: Boolean, upperBound: KType? = null): KType
Link copied to clipboard
internal fun Iterable<KType>.commonTypeListifyValues(useStar: Boolean = true): KType

Returns the common type of the given types including "listify" behaviour. Values and nulls will be wrapped in a list if they appear among other lists. For example: [Int, Nothing?, List<Int>] will become List<Int> instead of Any?. If there is another collection in there, it will become Any? anyway.

Link copied to clipboard
internal fun <T : Any> convert(src: Int, tartypeOf: KClass<T>): T
Link copied to clipboard
@JvmName(name = "convertNullableIterableToUnifiedNumberType")
internal fun Iterable<Number?>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Iterable<Number?>
@JvmName(name = "convertIterableToUnifiedNumberType")
internal fun Iterable<Number>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Iterable<Number>
@JvmName(name = "convertNullableSequenceToUnifiedNumberType")
internal fun Sequence<Number?>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Sequence<Number?>
@JvmName(name = "convertSequenceToUnifiedNumberType")
internal fun Sequence<Number>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Sequence<Number>

Converts the elements of the given iterable of numbers into a common numeric type based on complexity. The common numeric type is determined using the provided commonNumberType parameter or calculated with Iterable.unifiedNumberTypeOrNull from the iterable's elements if not explicitly specified.

Link copied to clipboard
internal fun createDataCollector(initCapacity: Int = 0): ColumnDataCollector
internal fun createDataCollector(initCapacity: Int = 0, typeOf: (KClass<*>) -> KType): ColumnDataCollector
internal fun <T> createDataCollector(initCapacity: Int = 0, type: KType): TypedColumnDataCollector<T>
Link copied to clipboard
internal fun createStarProjectedType(klass: KClass<*>, nullable: Boolean): KType
Link copied to clipboard
@JvmName(name = "createStarProjectedTypeExt")
internal fun KClass<*>.createStarProjectedType(nullable: Boolean): KType
Link copied to clipboard
internal fun Iterable<KClass<*>>.createType(nullable: Boolean, upperBound: KType? = null): KType
Link copied to clipboard
internal inline fun <reified T> KClass<*>.createTypeUsing(): KType
Link copied to clipboard
internal inline fun <reified T> createTypeWithArgument(typeArgument: KType? = null): KType
Link copied to clipboard
internal fun KClass<*>.createTypeWithArgument(argument: KType? = null, nullable: Boolean = false): KType
Link copied to clipboard
internal fun <T> dagOf(vararg edges: Pair<T, T>): DirectedAcyclicGraph<T>

Builds a new DirectedAcyclicGraph using the provided edges.

Link copied to clipboard
Link copied to clipboard
internal fun <T> Iterable<T>.equalsByElement(other: Iterable<T>): Boolean
Link copied to clipboard
internal fun <T, C> DataFrame<T>.getColumnPaths(unresolvedColumnsPolicy: UnresolvedColumnsPolicy, selector: ColumnsSelector<T, C>): List<ColumnPath>
Link copied to clipboard
internal fun <T, C> DataFrame<T>.getColumnsImpl(unresolvedColumnsPolicy: UnresolvedColumnsPolicy, selector: ColumnsSelector<T, C>): List<DataColumn<C>>
Link copied to clipboard
internal fun <T, C> DataFrame<T>.getColumnsWithPaths(unresolvedColumnsPolicy: UnresolvedColumnsPolicy, selector: ColumnsSelector<T, C>): List<ColumnWithPath<C>>
Link copied to clipboard
internal fun getListType(valueType: KType): KType
Link copied to clipboard
Link copied to clipboard
internal fun getUnifiedNumberClassGraph(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): DirectedAcyclicGraph<KClass<*>>

Number type graph, structured in terms of number complexity. A number can always be expressed losslessly by a number of a more complex type (any of its parents).

Link copied to clipboard
internal fun getUnifiedNumberClassOrNull(first: KClass<*>?, second: KClass<*>, options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KClass<*>?

Determines the nearest common numeric type, in terms of complexity, between two given classes/types.

Link copied to clipboard
internal fun getUnifiedNumberTypeGraph(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): DirectedAcyclicGraph<KType>

Number type graph, structured in terms of number complexity. A number can always be expressed losslessly by a number of a more complex type (any of its parents).

Link copied to clipboard
internal fun getUnifiedNumberTypeOrNull(first: KType?, second: KType, options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KType?

Determines the nearest common numeric type, in terms of complexity, between two given classes/types.

Link copied to clipboard
internal fun <T> getValuesType(values: List<T>, type: KType, infer: Infer): KType
Link copied to clipboard
internal fun guessValueType(values: Sequence<Any?>, upperBound: KType? = null, listifyValues: Boolean = false, allColsMakesRow: Boolean = false, unifyNumbers: Boolean = false): KType

Returns the guessed value type of the given values sequence.

Link copied to clipboard
internal inline fun <reified C> headPlusArray(head: C, cols: Array<out C>): Array<C>
internal fun headPlusArray(head: Byte, cols: ByteArray): ByteArray
internal fun headPlusArray(head: Char, cols: CharArray): CharArray
internal fun headPlusArray(head: Int, cols: IntArray): IntArray
internal fun headPlusArray(head: Long, cols: LongArray): LongArray
Link copied to clipboard
internal inline fun <reified C> headPlusIterable(head: C, cols: Iterable<C>): Iterable<C>
Link copied to clipboard
internal inline fun <C> Sequence<C>.indexOfBestBy(isBetterThan: IsBetterThan<C>): Int

Returns the index of the first element in this sequence that is better than all previous elements.

Link copied to clipboard
internal inline fun <C> Sequence<C>.indexOfBestNotNaBy(isBetterThan: IsBetterThan<C & Any>): Int

Returns the index of the first element in this sequence that is not NA (null or NaN) and is better than all previous elements.

Link copied to clipboard
internal inline fun <C> Sequence<C>.indexOfBestNotNullBy(isBetterThan: IsBetterThan<C & Any>): Int

Returns the index of the first element in this sequence that is not null and is better than all previous elements.

Link copied to clipboard
internal fun inheritanceChain(subClass: KClass<*>, superClass: KClass<*>): List<Pair<KClass<*>, KType>>
Link copied to clipboard
internal fun Any.isBigNumber(): Boolean
Link copied to clipboard
internal fun KCallable<*>.isGetterLike(): Boolean
internal fun KFunction<*>.isGetterLike(): Boolean
internal fun KProperty<*>.isGetterLike(): Boolean

Returns true if this callable is a getter-like function.

Link copied to clipboard

Checks whether this KType adheres to T : Comparable<T & Any>?, aka, it is mutually comparable with itself.

Link copied to clipboard

Returns true only when this type is exactly Number or Number?.

Link copied to clipboard

Returns true when this type is one of the following (nullable) types: Byte, Short, Int, Long, Float, or Double.

Link copied to clipboard

Returns true when this type is one of the following (nullable) types: Byte, Short, Int, Long, Float, Double, or Number.

Link copied to clipboard
Link copied to clipboard
internal fun javaDurationCanParse(value: String): Boolean

Checks if the string can be parsed as a java duration without throwing an exception.

Link copied to clipboard
internal fun <T> List<T>.last(count: Int): List<T>
Link copied to clipboard
internal fun <K, V> lazyMapOf(vararg entries: Pair<K, () -> V>): LazyMap<K, V>

Creates a Map that resolves values lazily.

Link copied to clipboard
Link copied to clipboard
internal fun nameGenerator(vararg usedNames: String): ColumnNameGenerator
Link copied to clipboard
Link copied to clipboard
internal fun nothingType(nullable: Boolean): KType
Link copied to clipboard
internal fun KType.projectDownTo(subClass: KClass<*>): KType
Link copied to clipboard
internal fun KType.projectTo(targetClass: KClass<*>): KType
Link copied to clipboard
internal fun KType.projectUpTo(superClass: KClass<*>): KType
Link copied to clipboard
internal fun <T> List<T>.removeAt(index: Int): List<T>
Link copied to clipboard
Link copied to clipboard
internal fun renderSchema(df: AnyFrame): String
internal fun renderSchema(schema: DataFrameSchema): String
Link copied to clipboard
internal fun AnyCol.renderShort(): String
Link copied to clipboard
internal fun renderType(type: KType?): String
internal fun renderType(column: AnyCol): String
internal fun renderType(column: ColumnSchema): String
Link copied to clipboard
internal fun KType.replace(substitution: Map<KTypeParameter, KType?>): KType

Changes generic type parameters to its upperbound, like List<T> -> List<Any?> and Comparable<T> -> Comparable<Nothing>. Works recursively as well.

Link copied to clipboard
internal fun resolve(actualType: KType, declaredType: KType): Map<KTypeParameter, KType?>
Link copied to clipboard
internal fun <T> Iterable<T>.rollingHash(): Int
Link copied to clipboard
internal fun Double.scale(): Int
internal fun Float.scale(): Int
internal fun Number.scale(): Int
internal fun <T : Number> DataColumn<T?>.scale(): Int
Link copied to clipboard
@JvmName(name = "splitByIndicesOverload")
internal fun <T> splitByIndices(list: List<T>, startIndices: Sequence<Int>): Sequence<List<T>>
Link copied to clipboard
internal fun <T> List<T>.splitByIndices(startIndices: Sequence<Int>): Sequence<List<T>>
internal fun <T> DataFrame<T>.splitByIndices(startIndices: Sequence<Int>): Sequence<DataFrame<T>>
Link copied to clipboard
internal fun <T> T?.throwAndSuggestIfNull(operation: String): T
Link copied to clipboard
Link copied to clipboard
fun String.toCamelCaseByDelimiters(delimiters: Regex = CAMEL_DEFAULT_DELIMITERS_REGEX, numberSeparator: String = "_"): String

Converts a string into lowerCamelCase using delimiters.

Link copied to clipboard
internal fun <T> T.toIterable(getNext: (T) -> T?): Iterable<T>
Link copied to clipboard
internal fun String.toSnakeCase(): String
Link copied to clipboard
internal fun String.truncate(limit: Int): RenderedContent
Link copied to clipboard
internal fun Iterable<Any?>.types(): Set<KType>

Returns a set of KType objects representing the star-projected types of the runtime classes of all unique elements in the iterable.

Link copied to clipboard
internal fun Iterable<KClass<*>>.unifiedNumberClassOrNull(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KClass<*>?

Determines the nearest common numeric type, in terms of complexity, all types in this.

Link copied to clipboard
internal fun Iterable<KType>.unifiedNumberTypeOrNull(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KType?

Determines the nearest common numeric type, in terms of complexity, all types in this.

Link copied to clipboard
internal fun <T, C> DataFrame<T>.valuesImpl(byRow: Boolean, columns: ColumnsSelector<T, C>): Sequence<C>
Link copied to clipboard
internal fun Iterable<KClass<*>>.withMostSuperclasses(): KClass<*>?