diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 0cef9fa5b..6297bb18e 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -26,10 +26,19 @@ plugins { // only mandatory if `kotlin.dataframe.add.ksp=false` in gradle.properties alias(ksp) + + id("org.jetbrains.kotlinx.benchmark") version "0.4.11" } idea } +benchmark { + targets { + register("test") { + } + } +} + group = "org.jetbrains.kotlinx" val jupyterApiTCRepo: String by project @@ -82,6 +91,12 @@ dependencies { } testImplementation(libs.kotlin.scriptingJvm) testImplementation(libs.jsoup) + +// testImplementation("org.openjdk.jol:jol-core:0.10") + implementation("org.openjdk.jol:jol-core:0.10") + implementation("it.unimi.dsi:fastutil:8.5.14") + implementation("io.deephaven:deephaven-csv:0.14.0") + testImplementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.11") } val samplesImplementation by configurations.getting { diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt new file mode 100644 index 000000000..f2eb89b72 --- /dev/null +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt @@ -0,0 +1,89 @@ +@file:OptIn(ExperimentalUnsignedTypes::class) + +package org.jetbrains.kotlinx.dataframe + +import org.jetbrains.kotlinx.dataframe.impl.columns.BOOLEAN +import org.jetbrains.kotlinx.dataframe.impl.columns.BYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.CHAR +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderImpl +import org.jetbrains.kotlinx.dataframe.impl.columns.DOUBLE +import org.jetbrains.kotlinx.dataframe.impl.columns.FLOAT +import org.jetbrains.kotlinx.dataframe.impl.columns.INT +import org.jetbrains.kotlinx.dataframe.impl.columns.LONG +import org.jetbrains.kotlinx.dataframe.impl.columns.SHORT +import org.jetbrains.kotlinx.dataframe.impl.columns.UBYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.UINT +import org.jetbrains.kotlinx.dataframe.impl.columns.ULONG +import org.jetbrains.kotlinx.dataframe.impl.columns.USHORT +import org.jetbrains.kotlinx.dataframe.impl.columns.ofBoxedArray +import org.jetbrains.kotlinx.dataframe.impl.columns.ofCollection +import org.jetbrains.kotlinx.dataframe.impl.columns.ofPrimitiveArray +import kotlin.reflect.KType +import kotlin.reflect.typeOf + +/** + * Represents the contents of a column; however, it may be implemented. + * The default implementation is found at [ColumnDataHolderImpl]. + */ +public interface ColumnDataHolder : List { + + public fun toSet(): Set + + public operator fun get(range: IntRange): List + + public fun add(element: T) + + public fun canAdd(element: T): Boolean + + public val distinct: Lazy> + + public companion object +} + +public fun Collection.toColumnDataHolder(type: KType, distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofCollection(this, type, distinct) + +public inline fun Collection.toColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + this.toColumnDataHolder(typeOf(), distinct) + +public fun Array.toColumnDataHolder(type: KType, distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofBoxedArray(this, type, distinct) + +public inline fun Array.toColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + this.toColumnDataHolder(typeOf(), distinct) + +public fun BooleanArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, BOOLEAN, distinct) + +public fun ByteArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, BYTE, distinct) + +public fun ShortArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, SHORT, distinct) + +public fun IntArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, INT, distinct) + +public fun LongArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, LONG, distinct) + +public fun FloatArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, FLOAT, distinct) + +public fun DoubleArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, DOUBLE, distinct) + +public fun CharArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, CHAR, distinct) + +public fun UByteArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, UBYTE, distinct) + +public fun UShortArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, USHORT, distinct) + +public fun UIntArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, UINT, distinct) + +public fun ULongArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, ULONG, distinct) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt index b61c9ae2d..aacf8a7f7 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt @@ -21,6 +21,8 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.FrameColumnImpl import org.jetbrains.kotlinx.dataframe.impl.columns.ValueColumnImpl import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.guessColumnType +import org.jetbrains.kotlinx.dataframe.impl.columns.ofCollection +import org.jetbrains.kotlinx.dataframe.impl.columns.ofBoxedArray import org.jetbrains.kotlinx.dataframe.impl.columns.toColumnKind import org.jetbrains.kotlinx.dataframe.impl.getValuesType import org.jetbrains.kotlinx.dataframe.impl.splitByIndices @@ -42,6 +44,49 @@ public interface DataColumn : BaseColumn { public companion object { + public fun createValueColumn( + name: String, + values: ColumnDataHolder, + type: KType, + defaultValue: T? = null, + ): ValueColumn = ValueColumnImpl(values, name, type, defaultValue) + + public fun createValueColumn(name: String, values: BooleanArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ByteArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ShortArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: IntArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: LongArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: FloatArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: DoubleArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: CharArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UByteArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UShortArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UIntArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ULongArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + /** * Creates [ValueColumn] using given [name], [values] and [type]. * @@ -56,7 +101,15 @@ public interface DataColumn : BaseColumn { type: KType, infer: Infer = Infer.None, defaultValue: T? = null, - ): ValueColumn = ValueColumnImpl(values, name, getValuesType(values, type, infer), defaultValue) + ): ValueColumn { + val valueType = getValuesType(values, type, infer) + return createValueColumn( + name = name, + values = ColumnDataHolder.ofCollection(values, valueType), + type = valueType, + defaultValue = defaultValue, + ) + } /** * Creates [ValueColumn] using given [name], [values] and reified column [type]. @@ -74,25 +127,56 @@ public interface DataColumn : BaseColumn { infer: Infer = Infer.None, ): ValueColumn = createValueColumn( - name, - values, - getValuesType( - values, - typeOf(), - infer, + name = name, + values = values, + type = getValuesType( + values = values, + type = typeOf(), + infer = infer, ), ) + public fun createValueColumn( + name: String, + values: Array, + type: KType, + infer: Infer = Infer.None, + defaultValue: T? = null, + ): ValueColumn { + val valueType = getValuesType(values.asList(), type, infer) + return createValueColumn( + name = name, + values = ColumnDataHolder.ofBoxedArray(values, valueType), + type = valueType, + defaultValue = defaultValue, + ) + } + + public inline fun createValueColumn( + name: String, + values: Array, + infer: Infer = Infer.None, + ): ValueColumn = + createValueColumn( + name = name, + values = values, + type = getValuesType(values.asList(), typeOf(), infer), + ) + public fun createColumnGroup(name: String, df: DataFrame): ColumnGroup = ColumnGroupImpl(name, df) public fun createFrameColumn(name: String, df: DataFrame, startIndices: Iterable): FrameColumn = - FrameColumnImpl(name, df.splitByIndices(startIndices.asSequence()).toList(), lazy { df.schema() }) + FrameColumnImpl( + name, + df.splitByIndices(startIndices.asSequence()).toList().toColumnDataHolder(), + lazy { df.schema() }, + ) public fun createFrameColumn( name: String, groups: List>, schema: Lazy? = null, - ): FrameColumn = FrameColumnImpl(name, groups, schema) + ): FrameColumn = FrameColumnImpl(name, groups.toColumnDataHolder(), schema) public fun createWithTypeInference( name: String, diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnSelectionDsl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnSelectionDsl.kt index 24da6d8c9..57153f510 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnSelectionDsl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnSelectionDsl.kt @@ -59,7 +59,7 @@ public interface ColumnSelectionDsl : ColumnsContainer { /** * Retrieves the value of this [ColumnPath] from the [DataFrame]. * This is a shorthand for [getColumn][ColumnsContainer.getColumn]`(myColumnPath)` and - * is most often used in combination with `operator fun String.get(column: String)`, + * is most often used in combination with `operator fun String.get(column: String)`, * for instance: * ```kotlin * "myColumn"["myNestedColumn"]() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt index 4d142de02..e4b24c3dc 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt @@ -8,6 +8,14 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.ExportAsHtml +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns +import org.jetbrains.kotlinx.dataframe.impl.DataFrameReceiver import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnsList import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_LIST_DATACOLUMN_GET import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_LIST_DATACOLUMN_GET_REPLACE @@ -187,7 +195,7 @@ public interface ColumnsSelectionDsl : // SingleColumn> * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` `[**`..`**][org.jetbrains.kotlinx.dataframe.api.ColumnRangeColumnsSelectionDsl.rangeTo]` `[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef] @@ -250,7 +258,7 @@ public interface ColumnsSelectionDsl : // SingleColumn> * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -313,7 +321,7 @@ public interface ColumnsSelectionDsl : // SingleColumn> * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -391,7 +399,16 @@ public interface ColumnsSelectionDsl : // SingleColumn> * * */ - public interface DslGrammar + public interface DslGrammar { + + + + + + + + + } /** * Invokes the given [ColumnsSelector] using this [ColumnsSelectionDsl]. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt index a1b8ed64a..bdc4d906c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt @@ -12,9 +12,13 @@ import org.jetbrains.kotlinx.dataframe.annotations.Refine import org.jetbrains.kotlinx.dataframe.api.DropNA.DropNASelectingOptions import org.jetbrains.kotlinx.dataframe.api.DropNaNs.DropNaNsSelectingOptions import org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions +import org.jetbrains.kotlinx.dataframe.api.Update.UpdateOperationArg import org.jetbrains.kotlinx.dataframe.columns.ColumnKind import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.NA import org.jetbrains.kotlinx.dataframe.documentation.NaN import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns @@ -144,13 +148,15 @@ internal interface FillNulls { * ``` * * `df.`[fillNulls][org.jetbrains.kotlinx.dataframe.api.fillNulls]`(Person::length, Person::age)` - * + * */ interface FillNullsSelectingOptions } private interface SetFillNullsOperationArg + + /** * ## The Fill Nulls Operation * @@ -159,12 +165,12 @@ private interface SetFillNullsOperationArg * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNulls.Grammar] * - * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) + * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNulls.FillNullsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill Nulls Overload * @@ -197,7 +203,7 @@ private interface SetFillNullsOperationArg * * `df.`[fillNulls][org.jetbrains.kotlinx.dataframe.api.fillNulls]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNulls(columns: ColumnsSelector): Update = @@ -211,12 +217,12 @@ public fun DataFrame.fillNulls(columns: ColumnsSelector): Updat * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNulls.Grammar] * - * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) + * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNulls.FillNullsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill Nulls Overload * @@ -226,7 +232,7 @@ public fun DataFrame.fillNulls(columns: ColumnsSelector): Updat * #### For example: * * `df.`[fillNulls][org.jetbrains.kotlinx.dataframe.api.fillNulls]`("length", "age")` - * + * * @param [columns] The [Strings][String] corresponding to the names of columns belonging to this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNulls(vararg columns: String): Update = fillNulls { columns.toColumnSet() } @@ -239,12 +245,12 @@ public fun DataFrame.fillNulls(vararg columns: String): Update = * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNulls.Grammar] * - * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) + * For more information: [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNulls.FillNullsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill Nulls Overload * @@ -256,7 +262,7 @@ public fun DataFrame.fillNulls(vararg columns: String): Update = * ``` * * `df.`[fillNulls][org.jetbrains.kotlinx.dataframe.api.fillNulls]`(Person::length, Person::age)` - * + * * @param [columns] The [KProperties][KProperty] corresponding to columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNulls(vararg columns: KProperty): Update = @@ -270,12 +276,12 @@ public fun DataFrame.fillNulls(vararg columns: KProperty): Update DataFrame.fillNulls(vararg columns: KProperty): Update()` * * `df.`[fillNulls][org.jetbrains.kotlinx.dataframe.api.fillNulls]`(length, age)` - * + * * @param [columns] The [Column References][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNulls(vararg columns: ColumnReference): Update = @@ -439,11 +445,15 @@ internal interface FillNaNs { * ``` * * `df.`[fillNaNs][org.jetbrains.kotlinx.dataframe.api.fillNaNs]`(Person::length, Person::age)` - * + * */ interface FillNaNsSelectingOptions } + + + + /** * ## The Fill NaNs Operation * @@ -452,12 +462,12 @@ internal interface FillNaNs { * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNaNs.Grammar] * - * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) + * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNaNs.FillNaNsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill NaNs Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. @@ -489,7 +499,7 @@ internal interface FillNaNs { * * `df.`[fillNaNs][org.jetbrains.kotlinx.dataframe.api.fillNaNs]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNaNs(columns: ColumnsSelector): Update = @@ -503,12 +513,12 @@ public fun DataFrame.fillNaNs(columns: ColumnsSelector): Update< * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNaNs.Grammar] * - * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) + * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNaNs.FillNaNsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill NaNs Overload * Select columns using their [column names][String] @@ -517,7 +527,7 @@ public fun DataFrame.fillNaNs(columns: ColumnsSelector): Update< * #### For example: * * `df.`[fillNaNs][org.jetbrains.kotlinx.dataframe.api.fillNaNs]`("length", "age")` - * + * * @param [columns] The [Strings][String] corresponding to the names of columns belonging to this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNaNs(vararg columns: String): Update = fillNaNs { columns.toColumnSet() } @@ -530,12 +540,12 @@ public fun DataFrame.fillNaNs(vararg columns: String): Update = * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNaNs.Grammar] * - * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) + * For more information: [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNaNs.FillNaNsSelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill NaNs Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). @@ -546,7 +556,7 @@ public fun DataFrame.fillNaNs(vararg columns: String): Update = * ``` * * `df.`[fillNaNs][org.jetbrains.kotlinx.dataframe.api.fillNaNs]`(Person::length, Person::age)` - * + * * @param [columns] The [KProperties][KProperty] corresponding to columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNaNs(vararg columns: KProperty): Update = fillNaNs { columns.toColumnSet() } @@ -559,12 +569,12 @@ public fun DataFrame.fillNaNs(vararg columns: KProperty): Update DataFrame.fillNaNs(vararg columns: KProperty): Update()` * * `df.`[fillNaNs][org.jetbrains.kotlinx.dataframe.api.fillNaNs]`(length, age)` - * + * * @param [columns] The [Column References][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNaNs(vararg columns: ColumnReference): Update = @@ -707,11 +717,15 @@ internal interface FillNA { * ``` * * `df.`[fillNA][org.jetbrains.kotlinx.dataframe.api.fillNA]`(Person::length, Person::age)` - * + * */ interface FillNASelectingOptions } + + + + /** * ## The Fill NA Operation * @@ -720,12 +734,12 @@ internal interface FillNA { * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNA.Grammar] * - * For more information: [See `fillNA` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillna) + * For more information: [See `fillNA` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillna) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNA.FillNASelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill NA Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. @@ -757,7 +771,7 @@ internal interface FillNA { * * `df.`[fillNA][org.jetbrains.kotlinx.dataframe.api.fillNA]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNA(columns: ColumnsSelector): Update = @@ -771,12 +785,12 @@ public fun DataFrame.fillNA(columns: ColumnsSelector): Update DataFrame.fillNA(columns: ColumnsSelector): Update DataFrame.fillNA(vararg columns: String): Update = fillNA { columns.toColumnSet() } @@ -798,12 +812,12 @@ public fun DataFrame.fillNA(vararg columns: String): Update = fi * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.FillNA.Grammar] * - * For more information: [See `fillNA` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillna) + * For more information: [See `fillNA` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillna) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.FillNA.FillNASelectingOptions] - * for all the selecting options. + * for all the selecting options. * * ### This Fill NA Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). @@ -814,7 +828,7 @@ public fun DataFrame.fillNA(vararg columns: String): Update = fi * ``` * * `df.`[fillNA][org.jetbrains.kotlinx.dataframe.api.fillNA]`(Person::length, Person::age)` - * + * * @param [columns] The [KProperties][KProperty] corresponding to columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNA(vararg columns: KProperty): Update = fillNA { columns.toColumnSet() } @@ -827,12 +841,12 @@ public fun DataFrame.fillNA(vararg columns: KProperty): Update DataFrame.fillNA(vararg columns: KProperty): Update()` * * `df.`[fillNA][org.jetbrains.kotlinx.dataframe.api.fillNA]`(length, age)` - * + * * @param [columns] The [Column References][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.fillNA(vararg columns: ColumnReference): Update = @@ -853,8 +867,22 @@ public fun DataFrame.fillNA(vararg columns: ColumnReference): Updat // endregion + + + + + + + + // region dropNulls + + + + + + /** * ## The Drop Nulls Operation * @@ -865,7 +893,7 @@ public fun DataFrame.fillNA(vararg columns: ColumnReference): Updat * Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default, * rows are dropped if any of the selected cells are `null`. * - * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) + * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) * ### This Drop Nulls Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. * (Any (combination of) [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]). @@ -896,7 +924,7 @@ public fun DataFrame.fillNA(vararg columns: ColumnReference): Updat * * `df.`[dropNulls][org.jetbrains.kotlinx.dataframe.api.dropNulls]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * `df.`[dropNulls][dropNulls]`(whereAllNull = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }` * @param whereAllNull `false` by default. * If `true`, rows are dropped if all selected cells are `null`. @@ -924,7 +952,7 @@ public fun DataFrame.dropNulls(whereAllNull: Boolean = false, columns: Co * Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default, * rows are dropped if any of the selected cells are `null`. * - * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) + * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) * ### This Drop Nulls Overload * This overload operates on all columns in the [DataFrame]. * @param whereAllNull `false` by default. @@ -943,7 +971,7 @@ public fun DataFrame.dropNulls(whereAllNull: Boolean = false): DataFrame< * Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default, * rows are dropped if any of the selected cells are `null`. * - * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) + * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) * ### This Drop Nulls Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). * @@ -953,7 +981,7 @@ public fun DataFrame.dropNulls(whereAllNull: Boolean = false): DataFrame< * ``` * * `df.`[dropNulls][org.jetbrains.kotlinx.dataframe.api.dropNulls]`(Person::length, Person::age)` - * + * * `df.`[dropNulls][dropNulls]`(Person::length, whereAllNull = true)` * @param whereAllNull `false` by default. * If `true`, rows are dropped if all selected cells are `null`. @@ -973,7 +1001,7 @@ public fun DataFrame.dropNulls(vararg columns: KProperty<*>, whereAllNull * Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default, * rows are dropped if any of the selected cells are `null`. * - * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) + * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) * ### This Drop Nulls Overload * Select columns using their [column names][String] * ([String API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.StringApi]). @@ -981,7 +1009,7 @@ public fun DataFrame.dropNulls(vararg columns: KProperty<*>, whereAllNull * #### For example: * * `df.`[dropNulls][org.jetbrains.kotlinx.dataframe.api.dropNulls]`("length", "age")` - * + * * `df.`[dropNulls][dropNulls]`("length", whereAllNull = true)` * @param whereAllNull `false` by default. * If `true`, rows are dropped if all selected cells are `null`. @@ -1001,7 +1029,7 @@ public fun DataFrame.dropNulls(vararg columns: String, whereAllNull: Bool * Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default, * rows are dropped if any of the selected cells are `null`. * - * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) + * For more information: [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) * ### This Drop Nulls Overload * Select columns using [column accessors][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] * ([Column Accessors API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.ColumnAccessorsApi]). @@ -1013,7 +1041,7 @@ public fun DataFrame.dropNulls(vararg columns: String, whereAllNull: Bool * `val age by `[column][org.jetbrains.kotlinx.dataframe.api.column]`<`[Double][Double]`>()` * * `df.`[dropNulls][org.jetbrains.kotlinx.dataframe.api.dropNulls]`(length, age)` - * + * * `df.`[dropNulls][dropNulls]`(length, whereAllNull = true)` * @param whereAllNull `false` by default. * If `true`, rows are dropped if all selected cells are `null`. @@ -1035,6 +1063,12 @@ public fun DataColumn.dropNulls(): DataColumn = // region dropNA + + + + + + /** * ## The Drop `NA` Operation * @@ -1044,7 +1078,7 @@ public fun DataColumn.dropNulls(): DataColumn = * Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. By default, * rows are dropped if any of the selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. * - * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) + * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) * ### This Drop NA Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. * (Any (combination of) [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]). @@ -1075,7 +1109,7 @@ public fun DataColumn.dropNulls(): DataColumn = * * `df.`[dropNA][org.jetbrains.kotlinx.dataframe.api.dropNA]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * `df.`[dropNA][dropNA]`(whereAllNA = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }` * @param whereAllNA `false` by default. * If `true`, rows are dropped if all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. @@ -1100,7 +1134,7 @@ public fun DataFrame.dropNA(whereAllNA: Boolean = false, columns: Columns * Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. By default, * rows are dropped if any of the selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. * - * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) + * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) * ### This Drop NA Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). * @@ -1110,7 +1144,7 @@ public fun DataFrame.dropNA(whereAllNA: Boolean = false, columns: Columns * ``` * * `df.`[dropNA][org.jetbrains.kotlinx.dataframe.api.dropNA]`(Person::length, Person::age)` - * + * * `df.`[dropNA][dropNA]`(Person::length, whereAllNA = true)` * @param whereAllNA `false` by default. * If `true`, rows are dropped if all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. @@ -1129,7 +1163,7 @@ public fun DataFrame.dropNA(vararg columns: KProperty<*>, whereAllNA: Boo * Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. By default, * rows are dropped if any of the selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. * - * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) + * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) * ### This Drop NA Overload * Select columns using their [column names][String] * ([String API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.StringApi]). @@ -1137,7 +1171,7 @@ public fun DataFrame.dropNA(vararg columns: KProperty<*>, whereAllNA: Boo * #### For example: * * `df.`[dropNA][org.jetbrains.kotlinx.dataframe.api.dropNA]`("length", "age")` - * + * * `df.`[dropNA][dropNA]`("length", whereAllNA = true)` * @param whereAllNA `false` by default. * If `true`, rows are dropped if all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. @@ -1156,7 +1190,7 @@ public fun DataFrame.dropNA(vararg columns: String, whereAllNA: Boolean = * Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. By default, * rows are dropped if any of the selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. * - * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) + * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) * ### This Drop NA Overload * Select columns using [column accessors][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] * ([Column Accessors API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.ColumnAccessorsApi]). @@ -1168,7 +1202,7 @@ public fun DataFrame.dropNA(vararg columns: String, whereAllNA: Boolean = * `val age by `[column][org.jetbrains.kotlinx.dataframe.api.column]`<`[Double][Double]`>()` * * `df.`[dropNA][org.jetbrains.kotlinx.dataframe.api.dropNA]`(length, age)` - * + * * `df.`[dropNA][dropNA]`(length, whereAllNA = true)` * @param whereAllNA `false` by default. * If `true`, rows are dropped if all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. @@ -1187,7 +1221,7 @@ public fun DataFrame.dropNA(vararg columns: AnyColumnReference, whereAllN * Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. By default, * rows are dropped if any of the selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA]. * - * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) + * For more information: [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) * ### This Drop NA Overload * This overload operates on all columns in the [DataFrame]. * @param whereAllNA `false` by default. @@ -1211,6 +1245,12 @@ public fun DataColumn.dropNA(): DataColumn = // region dropNaNs + + + + + + /** * ## The Drop `NaN` Operation * @@ -1220,7 +1260,7 @@ public fun DataColumn.dropNA(): DataColumn = * Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default, * rows are dropped if any of the selected cells are [`NaN`][Double.isNaN]. * - * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) + * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) * ### This Drop NaNs Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. * (Any (combination of) [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]). @@ -1251,7 +1291,7 @@ public fun DataColumn.dropNA(): DataColumn = * * `df.`[dropNaNs][org.jetbrains.kotlinx.dataframe.api.dropNaNs]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * `df.`[dropNaNs][dropNaNs]`(whereAllNaN = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }` * @param whereAllNaN `false` by default. * If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN]. @@ -1276,7 +1316,7 @@ public fun DataFrame.dropNaNs(whereAllNaN: Boolean = false, columns: Colu * Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default, * rows are dropped if any of the selected cells are [`NaN`][Double.isNaN]. * - * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) + * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) * ### This Drop NaNs Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). * @@ -1286,7 +1326,7 @@ public fun DataFrame.dropNaNs(whereAllNaN: Boolean = false, columns: Colu * ``` * * `df.`[dropNaNs][org.jetbrains.kotlinx.dataframe.api.dropNaNs]`(Person::length, Person::age)` - * + * * `df.`[dropNaNs][dropNaNs]`(Person::length, whereAllNaN = true)` * @param whereAllNaN `false` by default. * If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN]. @@ -1305,7 +1345,7 @@ public fun DataFrame.dropNaNs(vararg columns: KProperty<*>, whereAllNaN: * Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default, * rows are dropped if any of the selected cells are [`NaN`][Double.isNaN]. * - * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) + * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) * ### This Drop NaNs Overload * Select columns using their [column names][String] * ([String API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.StringApi]). @@ -1313,7 +1353,7 @@ public fun DataFrame.dropNaNs(vararg columns: KProperty<*>, whereAllNaN: * #### For example: * * `df.`[dropNaNs][org.jetbrains.kotlinx.dataframe.api.dropNaNs]`("length", "age")` - * + * * `df.`[dropNaNs][dropNaNs]`("length", whereAllNaN = true)` * @param whereAllNaN `false` by default. * If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN]. @@ -1332,7 +1372,7 @@ public fun DataFrame.dropNaNs(vararg columns: String, whereAllNaN: Boolea * Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default, * rows are dropped if any of the selected cells are [`NaN`][Double.isNaN]. * - * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) + * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) * ### This Drop NaNs Overload * Select columns using [column accessors][org.jetbrains.kotlinx.dataframe.columns.ColumnReference] * ([Column Accessors API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.ColumnAccessorsApi]). @@ -1344,7 +1384,7 @@ public fun DataFrame.dropNaNs(vararg columns: String, whereAllNaN: Boolea * `val age by `[column][org.jetbrains.kotlinx.dataframe.api.column]`<`[Double][Double]`>()` * * `df.`[dropNaNs][org.jetbrains.kotlinx.dataframe.api.dropNaNs]`(length, age)` - * + * * `df.`[dropNaNs][dropNaNs]`(length, whereAllNaN = true)` * @param whereAllNaN `false` by default. * If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN]. @@ -1363,7 +1403,7 @@ public fun DataFrame.dropNaNs(vararg columns: AnyColumnReference, whereAl * Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default, * rows are dropped if any of the selected cells are [`NaN`][Double.isNaN]. * - * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) + * For more information: [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) * ### This Drop NaNs Overload * This overload operates on all columns in the [DataFrame]. * @param whereAllNaN `false` by default. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt index 7f3a11c72..09482ac5c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt @@ -11,7 +11,20 @@ import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.Predicate import org.jetbrains.kotlinx.dataframe.RowFilter import org.jetbrains.kotlinx.dataframe.annotations.Interpretable +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.BehaviorArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.ColumnDoesNotExistArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.ExampleArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionColsArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.TitleArg import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.After +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.Before +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.From +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.PlainDslName +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.UpTo import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet @@ -21,6 +34,12 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.isSingleColumnWithGroup import org.jetbrains.kotlinx.dataframe.columns.size import org.jetbrains.kotlinx.dataframe.columns.values +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -86,19 +105,19 @@ public interface AllColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `colSelector: `[`ColumnSelector`][org.jetbrains.kotlinx.dataframe.ColumnSelector] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -107,7 +126,7 @@ public interface AllColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`all`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.all]**`()`** @@ -118,7 +137,7 @@ public interface AllColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -131,7 +150,7 @@ public interface AllColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -177,8 +196,14 @@ public interface AllColumnsSelectionDsl { public interface UpTo } + + + + // region all + + /** * ## All (Cols) * @@ -551,6 +576,8 @@ public interface AllColumnsSelectionDsl { */ private interface AllAfterDocs + + /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -579,7 +606,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` * * #### Flavors of All (Cols): * @@ -641,7 +668,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -703,7 +730,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -763,7 +790,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -823,7 +850,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -856,6 +883,8 @@ public interface AllColumnsSelectionDsl { public fun ColumnSet.allAfter(column: KProperty<*>): ColumnSet = allAfter(column.toColumnAccessor().path()) + + /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -884,7 +913,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -945,7 +974,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -1005,7 +1034,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -1065,7 +1094,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -1125,7 +1154,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -1158,6 +1187,8 @@ public interface AllColumnsSelectionDsl { public fun ColumnsSelectionDsl<*>.allAfter(column: KProperty<*>): ColumnSet<*> = allAfter(column.toColumnAccessor().path()) + + /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -1186,7 +1217,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -1252,7 +1283,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -1321,7 +1352,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -1381,7 +1412,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -1442,7 +1473,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -1475,6 +1506,8 @@ public interface AllColumnsSelectionDsl { public fun SingleColumn>.allColsAfter(column: KProperty<*>): ColumnSet<*> = allColsAfter(column.toColumnAccessor().path()) + + /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -1503,7 +1536,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -1563,7 +1596,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -1623,7 +1656,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -1683,7 +1716,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -1743,7 +1776,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsAfter][kotlin.String.allColsAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -1775,6 +1808,8 @@ public interface AllColumnsSelectionDsl { */ public fun String.allColsAfter(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsAfter(column) + + /** * ## All (Cols) After * @@ -1804,7 +1839,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -1865,7 +1900,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -1925,7 +1960,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -1985,7 +2020,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -2046,7 +2081,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -2078,6 +2113,8 @@ public interface AllColumnsSelectionDsl { */ public fun KProperty<*>.allColsAfter(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsAfter(column) + + /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -2106,7 +2143,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -2167,7 +2204,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -2227,7 +2264,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -2287,7 +2324,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -2348,7 +2385,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsAfter][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -2445,6 +2482,8 @@ public interface AllColumnsSelectionDsl { */ private interface AllFromDocs + + /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -2473,7 +2512,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` * * #### Flavors of All (Cols): * @@ -2535,7 +2574,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -2597,7 +2636,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -2657,7 +2696,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -2717,7 +2756,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -2749,6 +2788,8 @@ public interface AllColumnsSelectionDsl { */ public fun ColumnSet.allFrom(column: KProperty<*>): ColumnSet = allFrom(column.toColumnAccessor().path()) + + /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -2777,7 +2818,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -2838,7 +2879,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -2898,7 +2939,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -2958,7 +2999,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -3019,7 +3060,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -3051,6 +3092,8 @@ public interface AllColumnsSelectionDsl { */ public fun ColumnsSelectionDsl<*>.allFrom(column: KProperty<*>): ColumnSet<*> = asSingleColumn().allColsFrom(column) + + /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -3079,7 +3122,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -3145,7 +3188,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -3214,7 +3257,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -3274,7 +3317,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -3335,7 +3378,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsFrom][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -3368,6 +3411,8 @@ public interface AllColumnsSelectionDsl { public fun SingleColumn>.allColsFrom(column: KProperty<*>): ColumnSet<*> = allColsFrom(column.toColumnAccessor().path()) + + /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -3396,7 +3441,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -3456,7 +3501,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -3516,7 +3561,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -3576,7 +3621,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -3636,7 +3681,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsFrom][kotlin.String.allColsFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -3668,6 +3713,8 @@ public interface AllColumnsSelectionDsl { */ public fun String.allColsFrom(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsFrom(column) + + /** * ## All (Cols) From * @@ -3697,7 +3744,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -3758,7 +3805,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -3818,7 +3865,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -3878,7 +3925,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -3939,7 +3986,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -3971,6 +4018,8 @@ public interface AllColumnsSelectionDsl { */ public fun KProperty<*>.allColsFrom(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsFrom(column) + + /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -3999,7 +4048,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -4060,7 +4109,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -4120,7 +4169,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -4180,7 +4229,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -4240,7 +4289,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allFrom][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -4337,6 +4386,8 @@ public interface AllColumnsSelectionDsl { */ private interface AllBeforeDocs + + /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -4365,7 +4416,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` * * #### Flavors of All (Cols): * @@ -4427,7 +4478,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -4489,7 +4540,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -4549,7 +4600,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -4609,7 +4660,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -4642,6 +4693,8 @@ public interface AllColumnsSelectionDsl { public fun ColumnSet.allBefore(column: KProperty<*>): ColumnSet = allBefore(column.toColumnAccessor().path()) + + /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -4670,7 +4723,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -4731,7 +4784,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -4792,7 +4845,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -4852,7 +4905,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -4912,7 +4965,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -4945,6 +4998,8 @@ public interface AllColumnsSelectionDsl { public fun ColumnsSelectionDsl<*>.allBefore(column: KProperty<*>): ColumnSet<*> = allBefore(column.toColumnAccessor().path()) + + /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -4973,7 +5028,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -5039,7 +5094,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -5105,7 +5160,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -5165,7 +5220,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -5226,7 +5281,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -5259,6 +5314,8 @@ public interface AllColumnsSelectionDsl { public fun SingleColumn>.allColsBefore(column: KProperty<*>): ColumnSet<*> = allColsBefore(column.toColumnAccessor().path()) + + /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -5287,7 +5344,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -5348,7 +5405,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -5408,7 +5465,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -5468,7 +5525,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -5528,7 +5585,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsBefore][kotlin.String.allColsBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -5560,6 +5617,8 @@ public interface AllColumnsSelectionDsl { */ public fun String.allColsBefore(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsBefore(column) + + /** * ## All (Cols) Before * @@ -5589,7 +5648,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -5650,7 +5709,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -5710,7 +5769,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -5770,7 +5829,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -5831,7 +5890,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -5863,6 +5922,8 @@ public interface AllColumnsSelectionDsl { */ public fun KProperty<*>.allColsBefore(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsBefore(column) + + /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -5891,7 +5952,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -5952,7 +6013,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -6012,7 +6073,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -6072,7 +6133,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -6133,7 +6194,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsBefore][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -6230,6 +6291,8 @@ public interface AllColumnsSelectionDsl { */ private interface AllUpToDocs + + /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -6258,7 +6321,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]` { myColumn `[in][String.contains]` it.`[name][ColumnWithPath.name]` } }` * * #### Flavors of All (Cols): * @@ -6320,7 +6383,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -6382,7 +6445,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -6442,7 +6505,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -6502,7 +6565,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { .. }.`[allUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.allUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -6534,6 +6597,8 @@ public interface AllColumnsSelectionDsl { */ public fun ColumnSet.allUpTo(column: KProperty<*>): ColumnSet = allUpTo(column.toColumnAccessor().path()) + + /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -6562,7 +6627,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -6623,7 +6688,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -6683,7 +6748,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -6743,7 +6808,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -6804,7 +6869,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -6836,6 +6901,8 @@ public interface AllColumnsSelectionDsl { */ public fun ColumnsSelectionDsl<*>.allUpTo(column: KProperty<*>): ColumnSet<*> = asSingleColumn().allColsUpTo(column) + + /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -6864,7 +6931,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -6930,7 +6997,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -6999,7 +7066,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -7059,7 +7126,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -7120,7 +7187,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { someColumnGroup.`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -7153,6 +7220,8 @@ public interface AllColumnsSelectionDsl { public fun SingleColumn>.allColsUpTo(column: KProperty<*>): ColumnSet<*> = allColsUpTo(column.toColumnAccessor().path()) + + /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -7181,7 +7250,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -7241,7 +7310,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -7301,7 +7370,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -7361,7 +7430,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -7421,7 +7490,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "someColGroup".`[allColsUpTo][kotlin.String.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -7453,6 +7522,8 @@ public interface AllColumnsSelectionDsl { */ public fun String.allColsUpTo(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsUpTo(column) + + /** * ## All (Cols) Up To * @@ -7482,7 +7553,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -7543,7 +7614,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -7603,7 +7674,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -7663,7 +7734,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -7724,7 +7795,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -7756,6 +7827,8 @@ public interface AllColumnsSelectionDsl { */ public fun KProperty<*>.allColsUpTo(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsUpTo(column) + + /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -7784,7 +7857,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]` { myColumn } }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -7845,7 +7918,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`("pathTo"["myColumn"]) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -7905,7 +7978,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`("myColumn") }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -7965,7 +8038,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`(myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -8025,7 +8098,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`(Type::myColumn) }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["someColGroup"].`[allColsUpTo][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index 582be9bdf..44843eb1e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -11,6 +11,11 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.AccessApi.ExtensionPropertiesApiLink +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.aggregation.toColumns import org.jetbrains.kotlinx.dataframe.impl.columns.allColumnsExceptKeepingStructure import org.jetbrains.kotlinx.dataframe.impl.columns.changePath @@ -50,23 +55,23 @@ public interface AllExceptColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `colsSelector: `[`ColumnsSelector`][org.jetbrains.kotlinx.dataframe.ColumnsSelector] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `columnNoAccessor: `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `columnsResolver: `[`ColumnsResolver`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] @@ -75,7 +80,7 @@ public interface AllExceptColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`allExcept`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allExcept]**` { `**[`colsSelector`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnsSelectorDef]**` }`** @@ -86,7 +91,7 @@ public interface AllExceptColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -101,7 +106,7 @@ public interface AllExceptColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/and.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/and.kt index 2bd106c4b..e336657ff 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/and.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/and.kt @@ -4,11 +4,18 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.Grammar.InfixName +import org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.Grammar.Name import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DoubleIndent +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnsList import kotlin.reflect.KProperty @@ -32,15 +39,15 @@ public interface AndColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `columnOrSet: `[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` | `[`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -49,7 +56,7 @@ public interface AndColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [`columnOrSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnOrColumnSetDef]` `[**`and`**][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` [ `**`{`**` ] `[`columnOrSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnOrColumnSetDef]` [ `**`}`**` ]` @@ -60,7 +67,7 @@ public interface AndColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -71,7 +78,7 @@ public interface AndColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -199,7 +206,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -232,7 +239,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``{ colA `[`/`][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``{ colA `[`/`][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -264,7 +271,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``"colB"`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``"colB"`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -296,7 +303,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``Type::colB`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[`cols`][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]` { ... } `[`and`][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver.and]` ``Type::colB`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -368,7 +375,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -400,7 +407,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``{ colA `[`/`][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``{ colA `[`/`][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -432,7 +439,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``"colB"`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``"colB"`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -464,7 +471,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``Type::colB`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "colA" `[`and`][kotlin.String.and]` ``Type::colB`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -536,7 +543,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`Int`][Int]`>()`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -568,7 +575,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``{ colA `[/][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``{ colA `[/][DataColumn.div]` 2.0 `[`named`][ColumnReference.named]` "half colA" }`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -601,7 +608,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``"colB"`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``"colB"`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. @@ -633,7 +640,7 @@ public interface AndColumnsSelectionDsl { * * #### Example for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``Type::colB`` }` + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { Type::colA `[`and`][kotlin.reflect.KProperty.and]` ``Type::colB`` }` * * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains all the columns from the [ColumnsResolvers][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] on the left * and right side of the [and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and] operator. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt index 813aa781c..4eac63e05 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt @@ -5,11 +5,19 @@ import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.ColColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ColColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle @@ -38,19 +46,19 @@ public interface ColColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `index: `[`Int`][Int] - * + * *      * * `T: Column type` @@ -59,7 +67,7 @@ public interface ColColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`col`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.col]`[`**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**`]`**`(`**[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` | `[`index`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexDef]**`)`** @@ -68,7 +76,7 @@ public interface ColColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -79,7 +87,7 @@ public interface ColColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -283,7 +291,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. * */ @Deprecated(IDENTITY_FUNCTION, ReplaceWith(COL_REPLACE)) @@ -335,7 +343,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun SingleColumn>.col(col: ColumnAccessor): SingleColumn = this.ensureIsColumnGroup().transformSingle { @@ -390,7 +398,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun AnyColumnGroupAccessor.col(col: ColumnAccessor): ColumnAccessor = this.ensureIsColumnGroup().column(col.path()) @@ -441,7 +449,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun String.col(col: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(col.path()) @@ -492,7 +500,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun KProperty<*>.col(col: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(col.path()) @@ -543,7 +551,7 @@ public interface ColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun ColumnPath.col(col: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(col.path()) @@ -650,7 +658,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -703,7 +711,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun col(name: String): ColumnAccessor = column(name) @@ -755,7 +763,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -808,7 +816,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun SingleColumn>.col(name: String): SingleColumn = @@ -865,7 +873,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -918,7 +926,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun AnyColumnGroupAccessor.col(name: String): ColumnAccessor = this.ensureIsColumnGroup().column(name) @@ -970,7 +978,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1023,7 +1031,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun String.col(name: String): ColumnAccessor = @@ -1078,7 +1086,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1131,7 +1139,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun KProperty<*>.col(name: String): ColumnAccessor = @@ -1184,7 +1192,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1237,7 +1245,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [name] The name of the column. + * @param [name] The name of the column. * @param [C] The type of the column. */ public fun ColumnPath.col(name: String): ColumnAccessor = @@ -1345,7 +1353,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1398,7 +1406,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun col(path: ColumnPath): ColumnAccessor = column(path) @@ -1450,7 +1458,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1503,7 +1511,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun SingleColumn>.col(path: ColumnPath): SingleColumn = @@ -1560,7 +1568,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1613,7 +1621,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun AnyColumnGroupAccessor.col(path: ColumnPath): ColumnAccessor = @@ -1666,7 +1674,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1719,7 +1727,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun String.col(path: ColumnPath): ColumnAccessor = @@ -1772,7 +1780,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1825,7 +1833,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun KProperty<*>.col(path: ColumnPath): ColumnAccessor = @@ -1878,7 +1886,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -1931,7 +1939,7 @@ public interface ColColumnsSelectionDsl { * * * - * @param [path] The path to the column. + * @param [path] The path to the column. * @param [C] The type of the column. */ public fun ColumnPath.col(path: ColumnPath): ColumnAccessor = @@ -2037,7 +2045,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun col(property: KProperty): SingleColumn = column(property) @@ -2087,7 +2095,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun SingleColumn>.col(property: KProperty): SingleColumn = col(property.name) @@ -2137,7 +2145,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun AnyColumnGroupAccessor.col(property: KProperty): ColumnAccessor = this.ensureIsColumnGroup().column(property) @@ -2188,7 +2196,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun String.col(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(property) @@ -2239,7 +2247,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun KProperty<*>.col(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(property) @@ -2290,7 +2298,7 @@ public interface ColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the column. - * @param [C] The type of the column. + * @param [C] The type of the column. */ public fun ColumnPath.col(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().column(property) @@ -2399,7 +2407,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. * * @@ -2454,7 +2462,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. * */ @@ -2508,7 +2516,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -2562,7 +2570,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. */ public fun ColumnsSelectionDsl<*>.col(index: Int): SingleColumn = asSingleColumn().col(index) @@ -2615,7 +2623,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -2669,7 +2677,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. */ public fun SingleColumn>.col(index: Int): SingleColumn = @@ -2726,7 +2734,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -2780,7 +2788,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. */ public fun String.col(index: Int): SingleColumn = columnGroup(this).col(index) @@ -2833,7 +2841,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -2887,7 +2895,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. */ public fun KProperty<*>.col(index: Int): SingleColumn = columnGroup(this).col(index) @@ -2940,7 +2948,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colUnTyped") @@ -2994,7 +3002,7 @@ public interface ColColumnsSelectionDsl { * * * @param [index] The index of the column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column. */ public fun ColumnPath.col(index: Int): SingleColumn = columnGroup(this).col(index) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt index da08ed0b4..a3d7b8dcc 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt @@ -5,12 +5,20 @@ import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl @@ -38,19 +46,19 @@ public interface ColGroupColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `index: `[`Int`][Int] - * + * *      * * `T: Column type` @@ -59,7 +67,7 @@ public interface ColGroupColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`colGroup`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroup]`[`**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**`]`**`(`**[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` | `[`index`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexDef]**`)`** @@ -68,7 +76,7 @@ public interface ColGroupColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -79,7 +87,7 @@ public interface ColGroupColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -289,7 +297,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun colGroup(colGroup: ColumnAccessor>): ColumnAccessor> = colGroup.ensureIsColumnGroup() @@ -342,7 +350,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(colGroup: ColumnAccessor>): SingleColumn> = this.ensureIsColumnGroup().transformSingle { @@ -402,7 +410,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun AnyColumnGroupAccessor.colGroup(colGroup: ColumnAccessor>): ColumnAccessor> = this.ensureIsColumnGroup().columnGroup(colGroup.path()).ensureIsColumnGroup() @@ -455,7 +463,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun String.colGroup(colGroup: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(colGroup.path()).ensureIsColumnGroup() @@ -508,7 +516,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun KProperty<*>.colGroup(colGroup: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(colGroup.path()).ensureIsColumnGroup() @@ -561,7 +569,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun ColumnPath.colGroup(colGroup: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(colGroup.path()).ensureIsColumnGroup() @@ -672,7 +680,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -727,7 +735,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun colGroup(name: String): ColumnAccessor> = columnGroup(name).ensureIsColumnGroup() @@ -781,7 +789,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -836,7 +844,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(name: String): SingleColumn> = @@ -896,7 +904,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -951,7 +959,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun AnyColumnGroupAccessor.colGroup(name: String): ColumnAccessor> = @@ -1006,7 +1014,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1061,7 +1069,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun String.colGroup(name: String): ColumnAccessor> = @@ -1116,7 +1124,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1171,7 +1179,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun KProperty<*>.colGroup(name: String): ColumnAccessor> = @@ -1226,7 +1234,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1281,7 +1289,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the column group. */ public fun ColumnPath.colGroup(name: String): ColumnAccessor> = @@ -1393,7 +1401,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1448,7 +1456,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun colGroup(path: ColumnPath): ColumnAccessor> = columnGroup(path).ensureIsColumnGroup() @@ -1502,7 +1510,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1557,7 +1565,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(path: ColumnPath): SingleColumn> = @@ -1618,7 +1626,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1673,7 +1681,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun AnyColumnGroupAccessor.colGroup(path: ColumnPath): ColumnAccessor> = @@ -1728,7 +1736,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1783,7 +1791,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun String.colGroup(path: ColumnPath): ColumnAccessor> = @@ -1838,7 +1846,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -1893,7 +1901,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun KProperty<*>.colGroup(path: ColumnPath): ColumnAccessor> = @@ -1948,7 +1956,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -2003,7 +2011,7 @@ public interface ColGroupColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the column group. */ public fun ColumnPath.colGroup(path: ColumnPath): ColumnAccessor> = @@ -2113,7 +2121,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2168,7 +2176,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun colGroup(property: KProperty): SingleColumn> = columnGroup(property).ensureIsColumnGroup() @@ -2221,7 +2229,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2276,7 +2284,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(property: KProperty): SingleColumn> = colGroup(property.name) @@ -2329,7 +2337,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2384,7 +2392,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun AnyColumnGroupAccessor.colGroup(property: KProperty): ColumnAccessor> = this.ensureIsColumnGroup().columnGroup(property).ensureIsColumnGroup() @@ -2437,7 +2445,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2492,7 +2500,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun String.colGroup(property: KProperty): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(property).ensureIsColumnGroup() @@ -2545,7 +2553,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2600,7 +2608,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun KProperty<*>.colGroup(property: KProperty): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(property).ensureIsColumnGroup() @@ -2653,7 +2661,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupDataRowKProperty") @@ -2708,7 +2716,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the column group. + * @param [C] The type of the column group. */ public fun ColumnPath.colGroup(property: KProperty): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().columnGroup(property).ensureIsColumnGroup() @@ -2819,7 +2827,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. * */ @@ -2876,7 +2884,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. * */ @@ -2933,7 +2941,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -2989,7 +2997,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. */ public fun ColumnsSelectionDsl<*>.colGroup(index: Int): SingleColumn> = @@ -3045,7 +3053,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -3101,7 +3109,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(index: Int): SingleColumn> = @@ -3161,7 +3169,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -3217,7 +3225,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. */ public fun String.colGroup(index: Int): SingleColumn> = columnGroup(this).colGroup(index) @@ -3272,7 +3280,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -3328,7 +3336,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. */ public fun KProperty<*>.colGroup(index: Int): SingleColumn> = columnGroup(this).colGroup(index) @@ -3383,7 +3391,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colGroupUnTyped") @@ -3439,7 +3447,7 @@ public interface ColGroupColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the column group. */ public fun ColumnPath.colGroup(index: Int): SingleColumn> = columnGroup(this).colGroup(index) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt index 12b3beb5d..09891507f 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt @@ -5,6 +5,9 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.Predicate import org.jetbrains.kotlinx.dataframe.api.ColGroupsColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ColGroupsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColGroupsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColGroupsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference @@ -12,6 +15,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApi +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.util.COLS_SELECT_DSL_GROUP import org.jetbrains.kotlinx.dataframe.util.COLS_SELECT_DSL_GROUP_REPLACE @@ -37,11 +43,11 @@ public interface ColGroupsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -50,7 +56,7 @@ public interface ColGroupsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`colGroups`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroups]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -59,7 +65,7 @@ public interface ColGroupsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -70,7 +76,7 @@ public interface ColGroupsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt index ddf58b840..88d6de3a8 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt @@ -4,12 +4,21 @@ import org.jetbrains.kotlinx.dataframe.ColumnFilter import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ColsColumnsSelectionDsl.CommonColsDocs.Vararg.AccessorType +import org.jetbrains.kotlinx.dataframe.api.ColsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle @@ -35,31 +44,31 @@ public interface ColsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `index: `[`Int`][Int] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] - * + * *      * * `T: Column type` - * + * *      * * `indexRange: `[`IntRange`][IntRange] - * + * *      * * @@ -67,7 +76,7 @@ public interface ColsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`cols`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]`[`**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**`]`**`(`**[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]**`,`**` .. | `[`index`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexDef]**`,`**` .. | `[`indexRange`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexRangeDef]**`)`** @@ -82,7 +91,7 @@ public interface ColsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -99,7 +108,7 @@ public interface ColsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -1224,7 +1233,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnsSelectionDslColsVarargColumnReferenceDocs @@ -1259,7 +1268,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnsSelectionDsl<*>.cols( firstCol: ColumnReference, @@ -1297,7 +1306,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnsSelectionDsl<*>.get( firstCol: ColumnReference, @@ -1336,7 +1345,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface SingleColumnColsVarargColumnReferenceDocs @@ -1371,7 +1380,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun SingleColumn>.cols( firstCol: ColumnReference, @@ -1410,7 +1419,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun SingleColumn>.get( firstCol: ColumnReference, @@ -1449,7 +1458,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface StringColsVarargColumnReferenceDocs @@ -1484,7 +1493,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun String.cols(firstCol: ColumnReference, vararg otherCols: ColumnReference): ColumnSet = columnGroup(this).cols(firstCol, *otherCols) @@ -1520,7 +1529,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun String.get( firstCol: ColumnReference, @@ -1559,7 +1568,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface KPropertyColsVarargColumnReferenceDocs @@ -1594,7 +1603,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun KProperty<*>.cols( firstCol: ColumnReference, @@ -1632,7 +1641,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun KProperty<*>.get( firstCol: ColumnReference, @@ -1673,7 +1682,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnPathColsVarargColumnReferenceDocs @@ -1710,7 +1719,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnPath.cols(firstCol: ColumnReference, vararg otherCols: ColumnReference): ColumnSet = columnGroup(this).cols(firstCol, *otherCols) @@ -1748,7 +1757,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnPath.get( firstCol: ColumnReference, @@ -1793,7 +1802,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnsSelectionDslVarargStringDocs @@ -1830,7 +1839,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -1870,7 +1879,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnsSelectionDsl<*>.cols(firstCol: String, vararg otherCols: String): ColumnSet = this.asSingleColumn().cols(firstCol, *otherCols).cast() @@ -1908,7 +1917,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnsSelectionDsl<*>.get(firstCol: String, vararg otherCols: String): ColumnSet<*> = cols(firstCol, *otherCols) @@ -1945,7 +1954,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface SingleColumnColsVarargStringDocs @@ -1980,7 +1989,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2018,7 +2027,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun SingleColumn>.cols(firstCol: String, vararg otherCols: String): ColumnSet = colsInternal(listOf(firstCol, *otherCols).map { pathOf(it) }).cast() @@ -2055,7 +2064,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun SingleColumn>.get(firstCol: String, vararg otherCols: String): ColumnSet<*> = cols(firstCol, *otherCols) @@ -2092,7 +2101,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface StringColsVarargStringDocs @@ -2127,7 +2136,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2164,7 +2173,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun String.cols(firstCol: String, vararg otherCols: String): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -2200,7 +2209,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun String.get(firstCol: String, vararg otherCols: String): ColumnSet<*> = cols(firstCol, *otherCols) @@ -2237,7 +2246,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface KPropertiesColsVarargStringDocs @@ -2272,7 +2281,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2310,7 +2319,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun KProperty<*>.cols(firstCol: String, vararg otherCols: String): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -2346,7 +2355,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun KProperty<*>.get(firstCol: String, vararg otherCols: String): ColumnSet<*> = cols(firstCol, *otherCols) @@ -2383,7 +2392,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnPathColsVarargStringDocs @@ -2418,7 +2427,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2456,7 +2465,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnPath.cols(firstCol: String, vararg otherCols: String): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -2492,7 +2501,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnPath.get(firstCol: String, vararg otherCols: String): ColumnSet<*> = cols(firstCol, *otherCols) @@ -2535,7 +2544,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnsSelectionDslVarargColumnPathDocs @@ -2572,7 +2581,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2612,7 +2621,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnsSelectionDsl<*>.cols(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet = asSingleColumn().cols(firstCol, *otherCols) @@ -2650,7 +2659,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [String]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnsSelectionDsl<*>.get(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet<*> = cols(firstCol, *otherCols) @@ -2689,7 +2698,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface SingleColumnColsVarargColumnPathDocs @@ -2726,7 +2735,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2766,7 +2775,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun SingleColumn>.cols(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet = colsInternal(listOf(firstCol, *otherCols)).cast() @@ -2805,7 +2814,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun SingleColumn>.get( firstCol: ColumnPath, @@ -2846,7 +2855,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface StringColsVarargColumnPathDocs @@ -2883,7 +2892,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -2923,7 +2932,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun String.cols(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -2961,7 +2970,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun String.get(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet<*> = cols(firstCol, *otherCols) @@ -3000,7 +3009,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface KPropertiesColsVarargColumnPathDocs @@ -3037,7 +3046,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -3077,7 +3086,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun KProperty<*>.cols(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -3115,7 +3124,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun KProperty<*>.get(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet<*> = cols(firstCol, *otherCols) @@ -3154,7 +3163,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnPathColsVarargColumnPathDocs @@ -3191,7 +3200,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("colsUnTyped") @@ -3231,7 +3240,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnPath.cols(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet = columnGroup(this).cols(firstCol, *otherCols).cast() @@ -3269,7 +3278,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [ColumnPath][org.jetbrains.kotlinx.dataframe.columns.ColumnPath]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnPath.get(firstCol: ColumnPath, vararg otherCols: ColumnPath): ColumnSet<*> = cols(firstCol, *otherCols) @@ -3310,7 +3319,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnsSelectionDslColsVarargKPropertyDocs @@ -3345,7 +3354,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnsSelectionDsl<*>.cols(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = this.asSingleColumn().cols(firstCol, *otherCols) @@ -3381,7 +3390,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnsSelectionDsl<*>.get( firstCol: KProperty, @@ -3420,7 +3429,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface SingleColumnColsVarargKPropertyDocs @@ -3455,7 +3464,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun SingleColumn>.cols( firstCol: KProperty, @@ -3493,7 +3502,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun SingleColumn>.get( firstCol: KProperty, @@ -3532,7 +3541,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface StringColsVarargKPropertyDocs @@ -3567,7 +3576,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun String.cols(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = columnGroup(this).cols(firstCol, *otherCols) @@ -3603,7 +3612,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun String.get(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = cols(firstCol, *otherCols) @@ -3640,7 +3649,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface KPropertyColsVarargKPropertyDocs @@ -3675,7 +3684,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun KProperty<*>.cols(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = columnGroup(this).cols(firstCol, *otherCols) @@ -3711,7 +3720,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun KProperty<*>.get(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = cols(firstCol, *otherCols) @@ -3748,7 +3757,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ private interface ColumnPathColsVarargKPropertyDocs @@ -3783,7 +3792,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public fun ColumnPath.cols(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = columnGroup(this).cols(firstCol, *otherCols) @@ -3819,7 +3828,7 @@ public interface ColsColumnsSelectionDsl { * @param [otherCols] Optional additional [KProperty]s that point to relative columns. * @throws [IllegalArgumentException] if any of the given [ColumnReference][org.jetbrains.kotlinx.dataframe.columns.ColumnReference]s point to a column that doesn't * exist. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. + * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns that [firstCol] and [otherCols] point to. */ public operator fun ColumnPath.get(firstCol: KProperty, vararg otherCols: KProperty): ColumnSet = cols(firstCol, *otherCols) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt index c99d0b4bc..b1d647546 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt @@ -6,11 +6,17 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.api.ColsAtAnyDepthColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ColsAtAnyDepthColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColsAtAnyDepthColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColsAtAnyDepthColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.atAnyDepthImpl @@ -40,11 +46,11 @@ public interface ColsAtAnyDepthColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -53,7 +59,7 @@ public interface ColsAtAnyDepthColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`colsAtAnyDepth`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsAtAnyDepth]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -62,7 +68,7 @@ public interface ColsAtAnyDepthColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -73,7 +79,7 @@ public interface ColsAtAnyDepthColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt index 8acff349b..27fb97af6 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt @@ -4,11 +4,17 @@ import org.jetbrains.kotlinx.dataframe.ColumnFilter import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ColsInGroupsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColsInGroupsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColsInGroupsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_CHILDREN @@ -37,11 +43,11 @@ public interface ColsInGroupsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -50,7 +56,7 @@ public interface ColsInGroupsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`colsInGroups`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsInGroups]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -59,7 +65,7 @@ public interface ColsInGroupsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -70,7 +76,7 @@ public interface ColsInGroupsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOf.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOf.kt index ae8ccbe68..55e5c7d03 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOf.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOf.kt @@ -6,11 +6,17 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.api.ColsOfColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ColsOfColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColsOfColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColsOfColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.size +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import kotlin.reflect.KProperty import kotlin.reflect.KType @@ -36,27 +42,27 @@ public interface ColsOfColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `singleColumn: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>>` - * + * *      * * `columnGroupReference: `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] - * + * *      * * `T: Column type` - * + * *      * * `kType: `[`KType`][kotlin.reflect.KType] @@ -65,7 +71,7 @@ public interface ColsOfColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**colsOf**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**` [ `**`(`**[`kType`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.KTypeDef]**`)`**` ] [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -74,7 +80,7 @@ public interface ColsOfColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -85,7 +91,7 @@ public interface ColsOfColumnsSelectionDsl { * * ### On a column group reference: * - * + * *      * * @@ -93,7 +99,7 @@ public interface ColsOfColumnsSelectionDsl { * *     __`.`__[**`colsOf`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**` [ `**`(`**[`kType`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.KTypeDef]**`)`**` ] [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` * - * + * *      * * diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt index 6a103d9c2..fd7ae097a 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt @@ -3,6 +3,9 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.ColumnFilter import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ColsOfKindColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ColsOfKindColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ColsOfKindColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnKind import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference @@ -10,6 +13,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApi +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.headPlusArray import kotlin.reflect.KProperty @@ -34,15 +40,15 @@ public interface ColsOfKindColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] - * + * *      * * `kind: `[`ColumnKind`][org.jetbrains.kotlinx.dataframe.columns.ColumnKind] @@ -51,7 +57,7 @@ public interface ColsOfKindColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`colsOfKind`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroups]**`(`**[`kind`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnKindDef]**`,`**` ..`**`)`**` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -60,7 +66,7 @@ public interface ColsOfKindColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -71,7 +77,7 @@ public interface ColsOfKindColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt index 5c9b0d0ae..09e555d85 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnNameFilters.kt @@ -1,11 +1,16 @@ package org.jetbrains.kotlinx.dataframe.api +import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import kotlin.reflect.KProperty @@ -29,19 +34,19 @@ public interface ColumnNameFiltersColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `text: `[`String`][String] - * + * *      * * `ignoreCase: `[`Boolean`][Boolean] - * + * *      * * `regex: `[`Regex`][Regex] @@ -50,7 +55,7 @@ public interface ColumnNameFiltersColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`nameContains`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.nameContains]**`(`**[`text`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.TextDef]`[`**`, `**[`ignoreCase`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IgnoreCaseDef]`] | `[`regex`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.RegexDef]**`)`** @@ -61,7 +66,7 @@ public interface ColumnNameFiltersColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -74,7 +79,7 @@ public interface ColumnNameFiltersColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -119,6 +124,10 @@ public interface ColumnNameFiltersColumnsSelectionDsl { // region nameContains + + + + /** * ## (Cols) Name Contains * Returns a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns from [this] having @@ -604,8 +613,12 @@ public interface ColumnNameFiltersColumnsSelectionDsl { // endregion + + // region nameStartsWith + + @Deprecated("Use nameStartsWith instead", ReplaceWith("this.nameStartsWith(prefix)")) public fun ColumnSet.startsWith(prefix: CharSequence): TransformableColumnSet = nameStartsWith(prefix) @@ -850,6 +863,8 @@ public interface ColumnNameFiltersColumnsSelectionDsl { // region nameEndsWith + + @Deprecated("Use nameEndsWith instead", ReplaceWith("this.nameEndsWith(suffix)")) @Suppress("UNCHECKED_CAST") public fun ColumnSet.endsWith(suffix: CharSequence): TransformableColumnSet = diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnRange.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnRange.kt index ea63669d0..1f498c9e6 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnRange.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/columnRange.kt @@ -1,9 +1,13 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.AnyColumnReference +import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.ColumnRangeColumnsSelectionDsl.Grammar import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.createColumnSet import kotlin.reflect.KProperty @@ -33,7 +37,7 @@ public interface ColumnRangeColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` `[**`..`**][org.jetbrains.kotlinx.dataframe.api.ColumnRangeColumnsSelectionDsl.rangeTo]` `[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef] @@ -59,6 +63,8 @@ public interface ColumnRangeColumnsSelectionDsl { public interface PlainDslName } + + /** * ## Range of Columns * Creates a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns from [this] up to (and including) [endInclusive]. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt index a3b5aa625..574ff8db7 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt @@ -4,9 +4,12 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnReference import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.DistinctColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.DistinctColumnsSelectionDsl.Grammar.ColumnSetName import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.exceptions.DuplicateColumnNamesException import org.jetbrains.kotlinx.dataframe.impl.columns.DistinctColumnSet import org.jetbrains.kotlinx.dataframe.indices @@ -72,7 +75,7 @@ public interface DistinctColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/drop.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/drop.kt index 747b41eb3..d69b66c40 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/drop.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/drop.kt @@ -11,6 +11,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.size +import org.jetbrains.kotlinx.dataframe.documentation.CommonTakeAndDropDocs +import org.jetbrains.kotlinx.dataframe.documentation.CommonTakeAndDropWhileDocs +import org.jetbrains.kotlinx.dataframe.documentation.TakeAndDropColumnsSelectionDslGrammar import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle import org.jetbrains.kotlinx.dataframe.index @@ -87,15 +90,15 @@ public interface DropColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] - * + * *      * * `number: `[`Int`][Int] @@ -104,7 +107,7 @@ public interface DropColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`drop`**][ColumnsSelectionDsl.drop]`(`[**`Last`**][ColumnsSelectionDsl.dropLast]`)`**`(`**[`number`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.NumberDef]**`)`** @@ -115,7 +118,7 @@ public interface DropColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -128,7 +131,7 @@ public interface DropColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/expr.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/expr.kt index 6c26342a4..d952253d3 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/expr.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/expr.kt @@ -5,7 +5,10 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.api.ExprColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ExprColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.documentation.ColumnExpression +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak // region ColumnsSelectionDsl @@ -27,11 +30,11 @@ public interface ExprColumnsSelectionDsl { * * ### Definitions: * `name: `[`String`][String] - * + * *      * * `infer: `[`Infer`][org.jetbrains.kotlinx.dataframe.api.Infer] - * + * *      * * `expression: `[Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ColumnExpression] @@ -40,7 +43,7 @@ public interface ExprColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`expr`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.expr]**`(`**`[`[`name`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.NameDef]**`,`**`][`[`infer`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.InferDef]`]`**`) { `**[`expression`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnExpressionDef]**` }`** diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt index 06c410ee0..1e58cc09f 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt @@ -7,12 +7,16 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.Predicate import org.jetbrains.kotlinx.dataframe.RowFilter +import org.jetbrains.kotlinx.dataframe.api.FilterColumnsSelectionDsl.Grammar.ColumnSetName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.asColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.getTrueIndices import org.jetbrains.kotlinx.dataframe.indices @@ -69,7 +73,7 @@ public interface FilterColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -80,7 +84,7 @@ public interface FilterColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/first.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/first.kt index bbfd66d75..eef25fbeb 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/first.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/first.kt @@ -5,7 +5,11 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.RowFilter +import org.jetbrains.kotlinx.dataframe.api.FirstColumnsSelectionDsl.CommonFirstDocs.Examples import org.jetbrains.kotlinx.dataframe.api.FirstColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.FirstColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.FirstColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.FirstColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference @@ -14,6 +18,9 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.asColumnSet import org.jetbrains.kotlinx.dataframe.columns.size import org.jetbrains.kotlinx.dataframe.columns.values +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.singleOrNullWithTransformerImpl @@ -95,11 +102,11 @@ public interface FirstColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -108,7 +115,7 @@ public interface FirstColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`first`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.first]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -117,7 +124,7 @@ public interface FirstColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -128,7 +135,7 @@ public interface FirstColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt index 1536ac368..c88e0dd85 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt @@ -4,6 +4,9 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnGroupAccessor import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.FrameColColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.FrameColColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.FrameColColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath @@ -11,6 +14,11 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.FrameColumn import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl @@ -38,19 +46,19 @@ public interface FrameColColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `index: `[`Int`][Int] - * + * *      * * `T: Column type` @@ -59,7 +67,7 @@ public interface FrameColColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`frameCol`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.frameCol]`[`**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**`]`**`(`**[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` | `[`index`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexDef]**`)`** @@ -68,7 +76,7 @@ public interface FrameColColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -79,7 +87,7 @@ public interface FrameColColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -289,7 +297,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun frameCol(frameCol: ColumnAccessor>): ColumnAccessor> = frameCol.ensureIsFrameColumn() @@ -342,7 +350,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol( frameCol: ColumnAccessor>, @@ -404,7 +412,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun AnyColumnGroupAccessor.frameCol( frameCol: ColumnAccessor>, @@ -458,7 +466,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun String.frameCol(frameCol: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(frameCol.path()).ensureIsFrameColumn() @@ -511,7 +519,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun KProperty<*>.frameCol(frameCol: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(frameCol.path()).ensureIsFrameColumn() @@ -564,7 +572,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun ColumnPath.frameCol(frameCol: ColumnAccessor>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(frameCol.path()).ensureIsFrameColumn() @@ -675,7 +683,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -730,7 +738,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun frameCol(name: String): ColumnAccessor> = frameColumn(name).ensureIsFrameColumn() @@ -784,7 +792,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -839,7 +847,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(name: String): SingleColumn> = @@ -899,7 +907,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -954,7 +962,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun AnyColumnGroupAccessor.frameCol(name: String): ColumnAccessor> = @@ -1009,7 +1017,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1064,7 +1072,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun String.frameCol(name: String): ColumnAccessor> = @@ -1119,7 +1127,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1174,7 +1182,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun KProperty<*>.frameCol(name: String): ColumnAccessor> = @@ -1229,7 +1237,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1284,7 +1292,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the frame column. */ public fun ColumnPath.frameCol(name: String): ColumnAccessor> = @@ -1396,7 +1404,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1451,7 +1459,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun frameCol(path: ColumnPath): ColumnAccessor> = frameColumn(path).ensureIsFrameColumn() @@ -1505,7 +1513,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1560,7 +1568,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(path: ColumnPath): SingleColumn> = @@ -1620,7 +1628,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1675,7 +1683,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun AnyColumnGroupAccessor.frameCol(path: ColumnPath): ColumnAccessor> = @@ -1730,7 +1738,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1785,7 +1793,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun String.frameCol(path: ColumnPath): ColumnAccessor> = @@ -1840,7 +1848,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -1895,7 +1903,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun KProperty<*>.frameCol(path: ColumnPath): ColumnAccessor> = @@ -1950,7 +1958,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -2005,7 +2013,7 @@ public interface FrameColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the frame column. */ public fun ColumnPath.frameCol(path: ColumnPath): ColumnAccessor> = @@ -2115,7 +2123,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2170,7 +2178,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun frameCol(property: KProperty>): SingleColumn> = frameColumn(property).ensureIsFrameColumn() @@ -2223,7 +2231,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2278,7 +2286,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(property: KProperty>): SingleColumn> = frameCol(property.name) @@ -2331,7 +2339,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2386,7 +2394,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun AnyColumnGroupAccessor.frameCol(property: KProperty>): ColumnAccessor> = this.ensureIsColumnGroup().frameColumn(property).ensureIsFrameColumn() @@ -2439,7 +2447,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2494,7 +2502,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun String.frameCol(property: KProperty>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(property).ensureIsFrameColumn() @@ -2547,7 +2555,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2602,7 +2610,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun KProperty<*>.frameCol(property: KProperty>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(property).ensureIsFrameColumn() @@ -2655,7 +2663,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColDataFrameKProperty") @@ -2710,7 +2718,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the frame column. + * @param [C] The type of the frame column. */ public fun ColumnPath.frameCol(property: KProperty>): ColumnAccessor> = columnGroup(this).ensureIsColumnGroup().frameColumn(property).ensureIsFrameColumn() @@ -2821,7 +2829,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. * */ @@ -2878,7 +2886,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. * */ @@ -2935,7 +2943,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -2991,7 +2999,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. */ public fun ColumnsSelectionDsl<*>.frameCol(index: Int): SingleColumn> = @@ -3047,7 +3055,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -3103,7 +3111,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(index: Int): SingleColumn> = @@ -3164,7 +3172,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -3220,7 +3228,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. */ public fun String.frameCol(index: Int): SingleColumn> = columnGroup(this).frameCol(index) @@ -3275,7 +3283,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -3331,7 +3339,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. */ public fun KProperty<*>.frameCol(index: Int): SingleColumn> = columnGroup(this).frameCol(index) @@ -3386,7 +3394,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("frameColUnTyped") @@ -3442,7 +3450,7 @@ public interface FrameColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the frame column. */ public fun ColumnPath.frameCol(index: Int): SingleColumn> = columnGroup(this).frameCol(index) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCols.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCols.kt index 74a91151f..03dbd7f13 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCols.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCols.kt @@ -5,6 +5,9 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.Predicate import org.jetbrains.kotlinx.dataframe.annotations.Interpretable +import org.jetbrains.kotlinx.dataframe.api.FrameColsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.FrameColsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.FrameColsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet @@ -12,6 +15,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.FrameColumn import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApi +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import kotlin.reflect.KProperty @@ -35,11 +41,11 @@ public interface FrameColsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -48,7 +54,7 @@ public interface FrameColsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`frameCols`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroups]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -57,7 +63,7 @@ public interface FrameColsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -68,7 +74,7 @@ public interface FrameColsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/last.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/last.kt index 9c95dbda8..6da371f86 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/last.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/last.kt @@ -5,7 +5,11 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.RowFilter +import org.jetbrains.kotlinx.dataframe.api.LastColumnsSelectionDsl.CommonLastDocs.Examples import org.jetbrains.kotlinx.dataframe.api.LastColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.LastColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.LastColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.LastColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference @@ -14,6 +18,9 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.asColumnSet import org.jetbrains.kotlinx.dataframe.columns.size import org.jetbrains.kotlinx.dataframe.columns.values +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.singleOrNullWithTransformerImpl @@ -95,11 +102,11 @@ public interface LastColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -108,7 +115,7 @@ public interface LastColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`last`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.last]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -117,7 +124,7 @@ public interface LastColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -128,7 +135,7 @@ public interface LastColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/none.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/none.kt index dc1fe8a99..77b0efa55 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/none.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/none.kt @@ -1,8 +1,10 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.api.NoneColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnsList // region ColumnsSelectionDsl @@ -24,13 +26,13 @@ public interface NoneColumnsSelectionDsl { *      * * ### Definitions: - * + * * *      * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`none`**][org.jetbrains.kotlinx.dataframe.api.NoneColumnsSelectionDsl.none]**`()`** diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt index 0904549ce..7a8a7ae0d 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt @@ -6,12 +6,21 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.annotations.HasSchema import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.annotations.Refine +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.CommonRenameDocs.ParamNameArg +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.CommonRenameDocs.ParamTypeArg +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.CommonRenameDocs.ReceiverTypeArg +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.Grammar.InfixIntoName +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.Grammar.InfixNamedName +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.Grammar.IntoName +import org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.Grammar.NamedName import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.FrameColumn import org.jetbrains.kotlinx.dataframe.columns.renamedReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.impl.DELIMITED_STRING_REGEX import org.jetbrains.kotlinx.dataframe.impl.DELIMITERS_REGEX import org.jetbrains.kotlinx.dataframe.impl.api.renameImpl @@ -129,7 +138,7 @@ public interface RenameColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` `[**named**][org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.named]`/`[**into**][org.jetbrains.kotlinx.dataframe.api.RenameColumnsSelectionDsl.into]` `[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index d191507c1..acd4d0e4b 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -9,12 +9,19 @@ import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.annotations.Refine import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions import org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.Grammar.ColumnGroupName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.impl.columns.changePath import org.jetbrains.kotlinx.dataframe.impl.columns.createColumnSet import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SELECT_COLS @@ -101,11 +108,15 @@ internal interface Select { * ``` * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.select]`(Person::length, Person::age)` - * + * */ interface SelectSelectingOptions } + + + + /** * ## The Select Operation * @@ -144,7 +155,7 @@ internal interface Select { * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * @param [columns] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame]. */ @Refine @@ -168,7 +179,7 @@ public fun DataFrame.select(columns: ColumnsSelector): DataFrame * ``` * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.select]`(Person::length, Person::age)` - * + * * @param [columns] The [KProperties][KProperty] used to select the columns of this [DataFrame]. */ public fun DataFrame.select(vararg columns: KProperty<*>): DataFrame = select { columns.toColumnSet() } @@ -188,7 +199,7 @@ public fun DataFrame.select(vararg columns: KProperty<*>): DataFrame = * #### For example: * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.select]`("length", "age")` - * + * * @param [columns] The [Column Names][String] used to select the columns of this [DataFrame]. */ public fun DataFrame.select(vararg columns: String): DataFrame = select { columns.toColumnSet() } @@ -212,7 +223,7 @@ public fun DataFrame.select(vararg columns: String): DataFrame = selec * `val age by `[column][org.jetbrains.kotlinx.dataframe.api.column]`<`[Double][Double]`>()` * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.select]`(length, age)` - * + * * @param [columns] The [Column Accessors][ColumnReference] used to select the columns of this [DataFrame]. */ public fun DataFrame.select(vararg columns: AnyColumnReference): DataFrame = select { columns.toColumnSet() } @@ -239,11 +250,11 @@ public interface SelectColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `colsSelector: `[`ColumnsSelector`][org.jetbrains.kotlinx.dataframe.ColumnsSelector] @@ -256,7 +267,7 @@ public interface SelectColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt index 1be249486..a87863d79 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt @@ -3,8 +3,12 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.SimplifyColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.SimplifyColumnsSelectionDsl.Grammar.ColumnSetName import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.simplify import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.util.TOP_MESSAGE @@ -36,7 +40,7 @@ public interface SimplifyColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/single.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/single.kt index aceabd066..9b86e685e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/single.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/single.kt @@ -5,7 +5,11 @@ import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.RowExpression +import org.jetbrains.kotlinx.dataframe.api.SingleColumnsSelectionDsl.CommonSingleDocs.Examples import org.jetbrains.kotlinx.dataframe.api.SingleColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.SingleColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.SingleColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.SingleColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet @@ -13,6 +17,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.asColumnSet import org.jetbrains.kotlinx.dataframe.columns.values +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.singleOrNullWithTransformerImpl @@ -65,11 +72,11 @@ public interface SingleColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -78,7 +85,7 @@ public interface SingleColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`single`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.single]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -87,7 +94,7 @@ public interface SingleColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -98,7 +105,7 @@ public interface SingleColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt index c0b54beb5..cd0797ff2 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt @@ -14,6 +14,8 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.UnresolvedColumnsPolicy import org.jetbrains.kotlinx.dataframe.columns.ValueColumn import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.api.SortFlag import org.jetbrains.kotlinx.dataframe.impl.api.addFlag import org.jetbrains.kotlinx.dataframe.impl.api.sortByImpl diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/take.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/take.kt index 2c4d9430e..d47865c8d 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/take.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/take.kt @@ -10,6 +10,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.size +import org.jetbrains.kotlinx.dataframe.documentation.CommonTakeAndDropDocs +import org.jetbrains.kotlinx.dataframe.documentation.CommonTakeAndDropWhileDocs +import org.jetbrains.kotlinx.dataframe.documentation.TakeAndDropColumnsSelectionDslGrammar import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle import org.jetbrains.kotlinx.dataframe.index @@ -79,15 +82,15 @@ public interface TakeColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] - * + * *      * * `number: `[`Int`][Int] @@ -96,7 +99,7 @@ public interface TakeColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`take`**][ColumnsSelectionDsl.take]`(`[**`Last`**][ColumnsSelectionDsl.takeLast]`)`**`(`**[`number`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.NumberDef]**`)`** @@ -107,7 +110,7 @@ public interface TakeColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -120,7 +123,7 @@ public interface TakeColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt index fffbfe481..e7d259f72 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt @@ -12,10 +12,15 @@ import org.jetbrains.kotlinx.dataframe.api.Update.Grammar import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.toColumnSet +import org.jetbrains.kotlinx.dataframe.documentation.DocumentationUrls +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarLink +import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenDataFrame import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.documentation.SelectingRows import org.jetbrains.kotlinx.dataframe.impl.api.asFrameImpl @@ -43,6 +48,8 @@ public data class Update( public fun cast(): Update = Update(df, filter as RowValueFilter?, columns as ColumnsSelector) + + /** * ## [**`update`**][update] Operation Grammar * @@ -88,7 +95,7 @@ public data class Update( /** * The columns to update need to be selected. See [Selecting Columns][UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. */ public interface Columns { @@ -163,7 +170,7 @@ public data class Update( * ``` * * `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(Person::length, Person::age)` - * + * */ public interface UpdateSelectingOptions @@ -182,6 +189,12 @@ public data class Update( // region update + + + + + + /** * ## The Update Operation * @@ -190,12 +203,12 @@ public data class Update( * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.Update.Grammar] * - * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) + * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Update.UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. * ### This Update Overload * Select or express columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]. * (Any (combination of) [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]). @@ -226,7 +239,7 @@ public data class Update( * * `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Double][Double]`>() }` * - * + * * @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update. */ public fun DataFrame.update(columns: ColumnsSelector): Update = Update(this, null, columns) @@ -239,12 +252,12 @@ public fun DataFrame.update(columns: ColumnsSelector): Update DataFrame.update(columns: ColumnsSelector): Update DataFrame.update(vararg columns: String): Update = up * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.Update.Grammar] * - * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) + * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Update.UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. * ### This Update Overload * Select columns using [KProperties][KProperty] ([KProperties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.KPropertiesApi]). * @@ -283,7 +296,7 @@ public fun DataFrame.update(vararg columns: String): Update = up * ``` * * `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(Person::length, Person::age)` - * + * * ## Optional * Combine `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(...).`[with][org.jetbrains.kotlinx.dataframe.api.Update.with]` { ... }` * into `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(...) { ... }` @@ -299,12 +312,12 @@ public fun DataFrame.update(vararg columns: KProperty): Update DataFrame.update(vararg columns: KProperty): Update()` * * `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(length, age)` - * + * * ## Optional * Combine `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(...).`[with][org.jetbrains.kotlinx.dataframe.api.Update.with]` { ... }` * into `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]`(...) { ... }` @@ -345,6 +358,8 @@ public fun DataFrame.update(vararg columns: ColumnReference): Updat public fun Update.where(predicate: RowValueFilter): Update = copy(filter = filter and predicate) + + /** * ## At * Only update the columns at certain given [row indices][org.jetbrains.kotlinx.dataframe.api.CommonUpdateAtFunctionDoc.RowIndicesParam]: @@ -427,6 +442,8 @@ public fun Update.at(rowRange: IntRange): Update = where { in public fun Update.perRowCol(expression: RowColumnExpression): DataFrame = updateImpl { row, column, _ -> expression(row, column) } + + /** * ## Update Expression * @see ExpressionsGivenRow.RowValueExpression.WithExample @@ -461,6 +478,8 @@ public fun Update.with(expression: UpdateExpression): Dat expression(row, value) } + + /** ## As Frame * * Updates selected [column group][ColumnGroup] as a [DataFrame] with the given [expression]. @@ -476,6 +495,12 @@ public fun Update.with(expression: UpdateExpression): Dat public fun Update>.asFrame(expression: DataFrameExpression>): DataFrame = asFrameImpl(expression) + + + + + + /** * ## Per Col * @@ -569,6 +594,8 @@ public fun Update.perCol(values: AnyRow): DataFrame = perCol(val public fun Update.perCol(valueSelector: ColumnExpression): DataFrame = updateWithValuePerColumnImpl(valueSelector) + + /** Chains up two row value filters together. */ internal infix fun RowValueFilter?.and(other: RowValueFilter): RowValueFilter { if (this == null) return other @@ -629,12 +656,12 @@ public fun Update.notNull(expression: UpdateExpression): * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.Update.Grammar] * - * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) + * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Update.UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. * ### This Update Overload * This overload is a combination of [update] and [with][Update.with]. * @@ -669,12 +696,12 @@ public fun DataFrame.update( * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.Update.Grammar] * - * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) + * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Update.UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. * ### This Update Overload * This overload is a combination of [update] and [with][Update.with]. * @@ -708,12 +735,12 @@ public fun DataFrame.update( * * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.Update.Grammar] * - * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) + * For more information: [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) * *      * * The columns to update need to be selected. See [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Update.UpdateSelectingOptions] - * for all the selecting options. + * for all the selecting options. * ### This Update Overload * This overload is a combination of [update] and [with][Update.with]. * @@ -740,6 +767,8 @@ public fun DataFrame.update( expression: UpdateExpression, ): DataFrame = update(*headPlusArray(firstCol, cols)).with(expression) + + /** * ## With Null * Specific version of [with][org.jetbrains.kotlinx.dataframe.api.with] that simply sets the value of each selected row to `null`. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt index 82a2abf91..9803e4cca 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt @@ -5,6 +5,9 @@ import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath @@ -12,6 +15,11 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.ValueColumn +import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl @@ -39,19 +47,19 @@ public interface ValueColColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `column: `[`ColumnAccessor`][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor]` | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<*> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `index: `[`Int`][Int] - * + * *      * * `T: Column type` @@ -60,7 +68,7 @@ public interface ValueColColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`valueCol`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.valueCol]`[`**`<`**[`T`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnTypeDef]**`>`**`]`**`(`**[`column`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnDef]` | `[`index`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.IndexDef]**`)`** @@ -69,7 +77,7 @@ public interface ValueColColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -80,7 +88,7 @@ public interface ValueColColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] @@ -290,7 +298,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun valueCol(valueCol: ColumnAccessor): ColumnAccessor = valueCol.ensureIsValueColumn() @@ -342,7 +350,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(valueCol: ColumnAccessor): SingleColumn = this.ensureIsColumnGroup().transformSingle { @@ -402,7 +410,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun AnyColumnGroupAccessor.valueCol(valueCol: ColumnAccessor): ColumnAccessor = this.ensureIsColumnGroup().valueColumn(valueCol.path()).ensureIsValueColumn() @@ -455,7 +463,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun String.valueCol(valueCol: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(valueCol.path()).ensureIsValueColumn() @@ -508,7 +516,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun KProperty<*>.valueCol(valueCol: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(valueCol.path()).ensureIsValueColumn() @@ -561,7 +569,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [col] The [ColumnAccessor][org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor] pointing to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun ColumnPath.valueCol(valueCol: ColumnAccessor): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(valueCol.path()).ensureIsValueColumn() @@ -672,7 +680,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -727,7 +735,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun valueCol(name: String): ColumnAccessor = valueColumn(name).ensureIsValueColumn() @@ -781,7 +789,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -836,7 +844,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(name: String): SingleColumn = @@ -896,7 +904,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -951,7 +959,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun AnyColumnGroupAccessor.valueCol(name: String): ColumnAccessor = @@ -1006,7 +1014,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1061,7 +1069,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun String.valueCol(name: String): ColumnAccessor = @@ -1116,7 +1124,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1171,7 +1179,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun KProperty<*>.valueCol(name: String): ColumnAccessor = @@ -1226,7 +1234,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1281,7 +1289,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [name] The name of the value column. + * @param [name] The name of the value column. * @param [C] The type of the value column. */ public fun ColumnPath.valueCol(name: String): ColumnAccessor = @@ -1393,7 +1401,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1448,7 +1456,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun valueCol(path: ColumnPath): ColumnAccessor = valueColumn(path).ensureIsValueColumn() @@ -1502,7 +1510,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1557,7 +1565,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(path: ColumnPath): SingleColumn = @@ -1617,7 +1625,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1672,7 +1680,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun AnyColumnGroupAccessor.valueCol(path: ColumnPath): ColumnAccessor = @@ -1727,7 +1735,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1782,7 +1790,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun String.valueCol(path: ColumnPath): ColumnAccessor = @@ -1837,7 +1845,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -1892,7 +1900,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun KProperty<*>.valueCol(path: ColumnPath): ColumnAccessor = @@ -1947,7 +1955,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -2002,7 +2010,7 @@ public interface ValueColColumnsSelectionDsl { * * * - * @param [path] The path to the value column. + * @param [path] The path to the value column. * @param [C] The type of the value column. */ public fun ColumnPath.valueCol(path: ColumnPath): ColumnAccessor = @@ -2112,7 +2120,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun valueCol(property: KProperty): SingleColumn = valueColumn(property).ensureIsValueColumn() @@ -2164,7 +2172,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(property: KProperty): SingleColumn = valueCol(property.name) @@ -2217,7 +2225,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun AnyColumnGroupAccessor.valueCol(property: KProperty): ColumnAccessor = this.ensureIsColumnGroup().valueColumn(property).ensureIsValueColumn() @@ -2270,7 +2278,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun String.valueCol(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(property).ensureIsValueColumn() @@ -2323,7 +2331,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun KProperty<*>.valueCol(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(property).ensureIsValueColumn() @@ -2376,7 +2384,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [property] The [KProperty] reference to the value column. - * @param [C] The type of the value column. + * @param [C] The type of the value column. */ public fun ColumnPath.valueCol(property: KProperty): ColumnAccessor = columnGroup(this).ensureIsColumnGroup().valueColumn(property).ensureIsValueColumn() @@ -2487,7 +2495,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. * */ @@ -2543,7 +2551,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -2599,7 +2607,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. */ public fun ColumnsSelectionDsl<*>.valueCol(index: Int): SingleColumn = asSingleColumn().valueCol(index) @@ -2654,7 +2662,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -2710,7 +2718,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(index: Int): SingleColumn = @@ -2770,7 +2778,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -2826,7 +2834,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. */ public fun String.valueCol(index: Int): SingleColumn = columnGroup(this).valueCol(index) @@ -2881,7 +2889,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -2937,7 +2945,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. */ public fun KProperty<*>.valueCol(index: Int): SingleColumn = columnGroup(this).valueCol(index) @@ -2992,7 +3000,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. */ @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("valueColUnTyped") @@ -3048,7 +3056,7 @@ public interface ValueColColumnsSelectionDsl { * * * @param [index] The index of the value column. - * @throws [IndexOutOfBoundsException] if the index is out of bounds. + * @throws [IndexOutOfBoundsException] if the index is out of bounds. * @param [C] The type of the value column. */ public fun ColumnPath.valueCol(index: Int): SingleColumn = columnGroup(this).valueCol(index) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCols.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCols.kt index 560f1de6e..ab94fc9a1 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCols.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCols.kt @@ -3,6 +3,9 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.Predicate +import org.jetbrains.kotlinx.dataframe.api.ValueColsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.ValueColsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.ValueColsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnReference import org.jetbrains.kotlinx.dataframe.columns.ColumnSet @@ -11,6 +14,9 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.ValueColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApi +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import kotlin.reflect.KProperty @@ -34,11 +40,11 @@ public interface ValueColsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `condition: `[`ColumnFilter`][org.jetbrains.kotlinx.dataframe.ColumnFilter] @@ -47,7 +53,7 @@ public interface ValueColsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`valueCols`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.valueCols]` [ `**`{ `**[`condition`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ConditionDef]**` }`**` ]` @@ -56,7 +62,7 @@ public interface ValueColsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -67,7 +73,7 @@ public interface ValueColsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/withoutNulls.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/withoutNulls.kt index ed6f5ccb0..178d7e35c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/withoutNulls.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/withoutNulls.kt @@ -3,10 +3,16 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.WithoutNullsColumnsSelectionDsl.Grammar +import org.jetbrains.kotlinx.dataframe.api.WithoutNullsColumnsSelectionDsl.Grammar.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.api.WithoutNullsColumnsSelectionDsl.Grammar.ColumnSetName +import org.jetbrains.kotlinx.dataframe.api.WithoutNullsColumnsSelectionDsl.Grammar.PlainDslName import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.SingleColumn +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate +import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.transform import kotlin.reflect.KProperty @@ -30,7 +36,7 @@ public interface WithoutNullsColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] @@ -39,7 +45,7 @@ public interface WithoutNullsColumnsSelectionDsl { * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * * [**`withoutNulls`**][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.withoutNulls]**`()`** @@ -48,7 +54,7 @@ public interface WithoutNullsColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -59,7 +65,7 @@ public interface WithoutNullsColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/AccessApi.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/AccessApi.kt index 472d9f214..53794c03e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/AccessApi.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/AccessApi.kt @@ -1,5 +1,7 @@ package org.jetbrains.kotlinx.dataframe.documentation +import org.jetbrains.kotlinx.dataframe.documentation.AccessApi.AnyApiLinks + /** * ## Access APIs * diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DslGrammarTemplateColumnsSelectionDsl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DslGrammarTemplateColumnsSelectionDsl.kt index 59bc1e55c..d3faadbf9 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DslGrammarTemplateColumnsSelectionDsl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DslGrammarTemplateColumnsSelectionDsl.kt @@ -5,9 +5,14 @@ import org.jetbrains.kotlinx.dataframe.ColumnSelector import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDslLink import org.jetbrains.kotlinx.dataframe.columns.ColumnKind import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupRef +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetRef +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.UsageTemplateExample.ColumnGroupName +import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.UsageTemplateExample.ColumnSetName /* * This template is to be used in displaying the Usage / DSL grammar @@ -26,38 +31,38 @@ public interface DslGrammarTemplateColumnsSelectionDsl { *      * * ### Definitions: - * + * * *      * * ### What can be called directly in the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl]: * - * + * *      * - * + * * *      * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] * - * + * * *      * * ### What can be called on a [Column Group (reference)][DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] * - * + * * * * @@ -266,11 +271,11 @@ public interface DslGrammarTemplateColumnsSelectionDsl { * * ### Definitions: * `columnSet: `[`ColumnSet`][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]`<*>` - * + * *      * * `columnGroup: `[`SingleColumn`][org.jetbrains.kotlinx.dataframe.columns.SingleColumn]`<`[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`String`][String]` | `[`KProperty`][kotlin.reflect.KProperty]`<* | `[`DataRow`][org.jetbrains.kotlinx.dataframe.DataRow]`<*>> | `[`ColumnPath`][org.jetbrains.kotlinx.dataframe.columns.ColumnPath] - * + * *      * * `number: `[`Int`][Int] @@ -281,7 +286,7 @@ public interface DslGrammarTemplateColumnsSelectionDsl { * * ### What can be called on a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]: * - * + * *      * * [`columnSet`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnSetDef] @@ -292,7 +297,7 @@ public interface DslGrammarTemplateColumnsSelectionDsl { * * ### What can be called on a [Column Group (reference)][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef]: * - * + * *      * * [`columnGroup`][org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate.ColumnGroupDef] diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt index 74b044d49..3b4e835b0 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt @@ -10,6 +10,9 @@ import org.jetbrains.kotlinx.dataframe.api.insert import org.jetbrains.kotlinx.dataframe.api.map import org.jetbrains.kotlinx.dataframe.api.notNull import org.jetbrains.kotlinx.dataframe.api.with +import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.AddDataRowNote +import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowExpressionLink +import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpressionLink import org.jetbrains.kotlinx.dataframe.RowExpression as DfRowExpression import org.jetbrains.kotlinx.dataframe.RowValueExpression as DfRowValueExpression diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRowAndColumn.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRowAndColumn.kt index d619b3686..f86329de3 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRowAndColumn.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRowAndColumn.kt @@ -2,6 +2,7 @@ package org.jetbrains.kotlinx.dataframe.documentation import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.api.mean +import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpressionLink import org.jetbrains.kotlinx.dataframe.RowColumnExpression as DfRowColumnExpression /** diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingColumns.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingColumns.kt index ad11b0f85..1d790860a 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingColumns.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingColumns.kt @@ -3,7 +3,9 @@ package org.jetbrains.kotlinx.dataframe.documentation import org.jetbrains.kotlinx.dataframe.ColumnSelector import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.api.ColumnSelectionDslLink import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDslLink import org.jetbrains.kotlinx.dataframe.api.colsOf import org.jetbrains.kotlinx.dataframe.api.column import org.jetbrains.kotlinx.dataframe.api.fillNulls @@ -15,9 +17,14 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnAccessors +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnAccessorsLink import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnNames +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.ColumnNamesLink import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.Dsl +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.DslLink +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.DslSingleLink import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.KProperties +import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns.KPropertiesLink import kotlin.reflect.KProperty /** [Selecting Columns][SelectingColumns] */ diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingRows.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingRows.kt index 2c32ce1de..500b0b670 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingRows.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingRows.kt @@ -11,6 +11,8 @@ import org.jetbrains.kotlinx.dataframe.api.first import org.jetbrains.kotlinx.dataframe.api.format import org.jetbrains.kotlinx.dataframe.api.gather import org.jetbrains.kotlinx.dataframe.api.update +import org.jetbrains.kotlinx.dataframe.documentation.SelectingRows.RowConditionLink +import org.jetbrains.kotlinx.dataframe.documentation.SelectingRows.RowValueConditionLink import org.jetbrains.kotlinx.dataframe.index /** diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt index 2d7b7e7d7..a3924ef6b 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt @@ -2,11 +2,14 @@ package org.jetbrains.kotlinx.dataframe.impl import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.concat import org.jetbrains.kotlinx.dataframe.api.toDataFrame +import org.jetbrains.kotlinx.dataframe.impl.columns.empty +import org.jetbrains.kotlinx.dataframe.impl.columns.emptyForType import org.jetbrains.kotlinx.dataframe.impl.columns.guessColumnType import kotlin.reflect.KClass import kotlin.reflect.KType @@ -28,7 +31,7 @@ internal abstract class DataCollectorBase(initCapacity: Int) : DataCollector< override var hasNulls = false - override val data = ArrayList(initCapacity) + override val data = ColumnDataHolder.empty(initCapacity) val values: List get() = data @@ -62,8 +65,15 @@ internal class TypedColumnDataCollector(initCapacity: Int = 0, val type: KTyp internal val kclass = type.jvmErasure + override val data: ColumnDataHolder = + ColumnDataHolder.emptyForType( + type = type, + initCapacity = initCapacity, + strictTypes = checkTypes, + ) + override fun add(value: T?) { - if (checkTypes && value != null && !value.javaClass.kotlin.isSubclassOf(kclass)) { + if (checkTypes && data.canAdd(value) && value != null && !value.javaClass.kotlin.isSubclassOf(kclass)) { throw IllegalArgumentException( "Can not add value of class ${value.javaClass.kotlin.qualifiedName} to column of type $type. Value = $value", ) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt new file mode 100644 index 000000000..3fd7393c7 --- /dev/null +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt @@ -0,0 +1,744 @@ +@file:OptIn(ExperimentalUnsignedTypes::class) + +package org.jetbrains.kotlinx.dataframe.impl.columns + +import it.unimi.dsi.fastutil.booleans.BooleanArrayList +import it.unimi.dsi.fastutil.bytes.ByteArrayList +import it.unimi.dsi.fastutil.chars.CharArrayList +import it.unimi.dsi.fastutil.doubles.DoubleArrayList +import it.unimi.dsi.fastutil.floats.FloatArrayList +import it.unimi.dsi.fastutil.ints.IntAVLTreeSet +import it.unimi.dsi.fastutil.ints.IntArrayList +import it.unimi.dsi.fastutil.ints.IntSortedSet +import it.unimi.dsi.fastutil.longs.LongArrayList +import it.unimi.dsi.fastutil.shorts.ShortArrayList +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder +import org.jetbrains.kotlinx.dataframe.impl.asList +import org.jetbrains.kotlinx.dataframe.impl.isArray +import org.jetbrains.kotlinx.dataframe.impl.isPrimitiveArray +import kotlin.reflect.KType +import kotlin.reflect.full.withNullability +import kotlin.reflect.typeOf + +/** + * Using the [ofPrimitiveArray] functions, this can store natively without converting: + * - [BooleanArray] + * - [ByteArray] + * - [ShortArray] + * - [IntArray] + * - [LongArray] + * - [FloatArray] + * - [DoubleArray] + * - [CharArray] + * - [UByteArray] + * - [UShortArray] + * - [UIntArray] + * - [ULongArray] + * + * Store with converting to primitive arrays: + * - [Array][Array]`<`[Boolean?][Boolean]`>` + * - [Array][Array]`<`[Byte?][Byte]`>` + * - [Array][Array]`<`[Short?][Short]`>` + * - [Array][Array]`<`[Int?][Int]`>` + * - [Array][Array]`<`[Long?][Long]`>` + * - [Array][Array]`<`[Float?][Float]`>` + * - [Array][Array]`<`[Double?][Double]`>` + * - [Array][Array]`<`[Char?][Char]`>` + * - [Array][Array]`<`[UByte?][UByte]`>` + * - [Array][Array]`<`[UShort?][UShort]`>` + * - [Array][Array]`<`[UInt?][UInt]`>` + * - [Array][Array]`<`[ULong?][ULong]`>` + * - [Collection][Collection]`<`[Boolean?][Boolean]`>` + * - [Collection][Collection]`<`[Byte?][Byte]`>` + * - [Collection][Collection]`<`[Short?][Short]`>` + * - [Collection][Collection]`<`[Int?][Int]`>` + * - [Collection][Collection]`<`[Long?][Long]`>` + * - [Collection][Collection]`<`[Float?][Float]`>` + * - [Collection][Collection]`<`[Double?][Double]`>` + * - [Collection][Collection]`<`[Char?][Char]`>` + * - [Collection][Collection]`<`[UByte?][UByte]`>` + * - [Collection][Collection]`<`[UShort?][UShort]`>` + * - [Collection][Collection]`<`[UInt?][UInt]`>` + * - [Collection][Collection]`<`[ULong?][ULong]`>` + * + * Yes, as you can see, also nullable types are supported. The values are stored in primitive arrays, + * and a separate array is used to store the indices of the null values. + * + * Since, [ColumnDataHolder] can be used as a [List], this is invisible to the user. + * + * Store them as is: + * - [Array][Array]`<`[Any?][Any]`>` + * - [Collection][Collection]`<`[Any?][Any]`>` + * + */ +internal class ColumnDataHolderImpl( + private var list: MutableList = PrimitiveArrayList() as MutableList, + distinct: Lazy>? = null, + private var zeroValue: Any? = Undefined, + private val nullIndices: IntSortedSet = IntAVLTreeSet(), + private val strictTypes: Boolean = false, +) : ColumnDataHolder { + + private object Undefined + + override val distinct = distinct ?: lazy { + buildSet { + if (usesPrimitiveArrayList) { + var anyNull = false + for (i in list.indices) { + if (i in nullIndices) { + anyNull = true + } else { + add(list[i]) + } + } + if (anyNull) add(null as T) + } else { + addAll(list) + } + }.toMutableSet() + } + + override val size: Int get() = list.size + + var usesPrimitiveArrayList = list is PrimitiveArrayList<*> + + override fun canAdd(element: T): Boolean = + when { + !usesPrimitiveArrayList -> true + !strictTypes -> true + element == null -> true + list is PrimitiveArrayList<*> -> (list as PrimitiveArrayList<*>).canAdd(element) + else -> true + } + + private var leadingNulls = 0 + + override fun add(element: T) { + // check if we need to switch to a boxed mutable list to add this element + if (usesPrimitiveArrayList && element != null && !(list as PrimitiveArrayList<*>).canAdd(element)) { + if (strictTypes) { + throw IllegalArgumentException( + "Cannot add value of class ${ + element!!::class.simpleName + } to strict column data holder of type ${(list as PrimitiveArrayList<*>).state}. Value = $element", + ) + } + list = this.toMutableList() + usesPrimitiveArrayList = false + } + + if (distinct.isInitialized()) { + distinct.value as MutableSet += element + } + + if (!usesPrimitiveArrayList) { + list += element + return + } + + if (element == null) { + nullIndices += size + + if (zeroValue is Undefined) { + leadingNulls++ + } else { + list += zeroValue as T + } + } else { + // set a new zeroValue if the current one is unset + if (zeroValue is Undefined) { + zeroValue = zeroValueFor(element) + if (leadingNulls > 0) { + repeat(leadingNulls) { + list += zeroValue as T + } + leadingNulls = 0 + } + } + + list += element + } + } + + override fun isEmpty(): Boolean = list.isEmpty() + + override fun indexOf(element: T): Int { + if (!usesPrimitiveArrayList) return list.indexOf(element) + + if (element == null) return nullIndices.firstInt() + for (i in list.indices) { + if (i in nullIndices) continue + if (list[i] == element) return i + } + return -1 + } + + override fun containsAll(elements: Collection): Boolean = elements.toSet().all { contains(it) } + + override fun toSet(): Set = distinct.value + + override fun get(index: Int): T = + if (usesPrimitiveArrayList && index in nullIndices) { + null as T + } else { + list[index] + } + + override fun get(range: IntRange): MutableList { + if (!usesPrimitiveArrayList) return list.subList(range.first, range.last + 1) + + val start = range.first + val sublist = list.subList(start, range.last + 1).toMutableList() + for (i in sublist.indices) { + if (start + i in nullIndices) sublist[i] = null as T + } + return sublist + } + + override fun contains(element: T): Boolean = + if (usesPrimitiveArrayList && element == null) { + nullIndices.isNotEmpty() + } else { + element in list + } + + override fun iterator(): Iterator = listIterator() + + override fun listIterator(): ListIterator = listIterator(0) + + override fun listIterator(index: Int): ListIterator = + if (!usesPrimitiveArrayList) { + list.listIterator(index) + } else { + object : ListIterator { + + val iterator = list.listIterator(index) + + override fun hasNext(): Boolean = iterator.hasNext() + + override fun hasPrevious(): Boolean = iterator.hasNext() + + override fun next(): T { + val i = nextIndex() + val res = iterator.next() + return if (i in nullIndices) null as T else res + } + + override fun nextIndex(): Int = iterator.nextIndex() + + override fun previous(): T { + val i = previousIndex() + val res = iterator.previous() + return if (i in nullIndices) null as T else res + } + + override fun previousIndex(): Int = iterator.previousIndex() + } + } + + override fun subList(fromIndex: Int, toIndex: Int): MutableList = get(fromIndex..).joinToString(prefix = "[", postfix = "]") +} + +@JvmInline +internal value class SortedIntArray(val array: IntArray = intArrayOf()) : Collection { + + override val size: Int get() = array.size + + override fun isEmpty(): Boolean = array.isEmpty() + + override fun iterator(): Iterator = array.iterator() + + override fun containsAll(elements: Collection): Boolean = elements.all { contains(it) } + + override fun contains(element: Int): Boolean = array.binarySearch(element) >= 0 +} + +internal val BOOLEAN = typeOf() +internal val BYTE = typeOf() +internal val SHORT = typeOf() +internal val INT = typeOf() +internal val LONG = typeOf() +internal val FLOAT = typeOf() +internal val DOUBLE = typeOf() +internal val CHAR = typeOf() +internal val UBYTE = typeOf() +internal val USHORT = typeOf() +internal val UINT = typeOf() +internal val ULONG = typeOf() +internal val ANY = typeOf() + +internal val NULLABLE_BOOLEAN = typeOf() +internal val NULLABLE_BYTE = typeOf() +internal val NULLABLE_SHORT = typeOf() +internal val NULLABLE_INT = typeOf() +internal val NULLABLE_LONG = typeOf() +internal val NULLABLE_FLOAT = typeOf() +internal val NULLABLE_DOUBLE = typeOf() +internal val NULLABLE_CHAR = typeOf() +internal val NULLABLE_UBYTE = typeOf() +internal val NULLABLE_USHORT = typeOf() +internal val NULLABLE_UINT = typeOf() +internal val NULLABLE_ULONG = typeOf() +internal val NULLABLE_ANY = typeOf() + +internal fun zeroValueOf(type: KType): Any? = + when (type) { + NULLABLE_BOOLEAN, BOOLEAN -> false + NULLABLE_BYTE, BYTE -> 0.toByte() + NULLABLE_SHORT, SHORT -> 0.toShort() + NULLABLE_INT, INT -> 0 + NULLABLE_LONG, LONG -> 0L + NULLABLE_FLOAT, FLOAT -> 0.0f + NULLABLE_DOUBLE, DOUBLE -> 0.0 + NULLABLE_CHAR, CHAR -> 0.toChar() + NULLABLE_UBYTE, UBYTE -> 0.toUByte() + NULLABLE_USHORT, USHORT -> 0.toUShort() + NULLABLE_UINT, UINT -> 0.toUInt() + NULLABLE_ULONG, ULONG -> 0.toULong() + else -> null + } + +internal fun zeroValueFor(element: Any?): Any? = + when (element) { + null -> null + is Boolean -> false + is Byte -> 0.toByte() + is Short -> 0.toShort() + is Int -> 0 + is Long -> 0L + is Float -> 0.0f + is Double -> 0.0 + is Char -> 0.toChar() + is UByte -> 0.toUByte() + is UShort -> 0.toUShort() + is UInt -> 0.toUInt() + is ULong -> 0.toULong() + else -> null + } + +private fun Array.fillNulls(zeroValue: Any, nullIndices: BooleanArray): Array { + for (i in indices) { + if (this[i] == null) { + this[i] = zeroValue as T + nullIndices[i] = true + } + } + return this as Array +} + +private fun MutableList.fillNulls(zeroValue: Any, nullIndices: BooleanArray): List { + for (i in indices) { + if (this[i] == null) { + this[i] = zeroValue as T + nullIndices[i] = true + } + } + return this as List +} + +private fun BooleanArray.indicesWhereTrue(): IntSortedSet { + val set = IntAVLTreeSet() + for (i in indices) { + if (this[i]) set += i + } + return set +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [collection]. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofCollection( + collection: Collection, + type: KType, + distinct: Lazy>? = null, + strictTypes: Boolean = false, +): ColumnDataHolder { + if (collection is ColumnDataHolder<*>) return collection as ColumnDataHolder + + try { + val isNull = BooleanArray(collection.size) + val newList = when (type) { + BOOLEAN -> BooleanArrayList((collection as Collection).toBooleanArray()).asPrimitiveArrayList() + + BYTE -> ByteArrayList((collection as Collection).toByteArray()).asPrimitiveArrayList() + + SHORT -> ShortArrayList((collection as Collection).toShortArray()).asPrimitiveArrayList() + + INT -> IntArrayList((collection as Collection).toIntArray()).asPrimitiveArrayList() + + LONG -> LongArrayList((collection as Collection).toLongArray()).asPrimitiveArrayList() + + FLOAT -> FloatArrayList((collection as Collection).toFloatArray()).asPrimitiveArrayList() + + DOUBLE -> DoubleArrayList((collection as Collection).toDoubleArray()).asPrimitiveArrayList() + + CHAR -> CharArrayList((collection as Collection).toCharArray()).asPrimitiveArrayList() + +// UBYTE -> (collection as Collection).toUByteArray().asList() +// +// USHORT -> (collection as Collection).toUShortArray().asList() +// +// UINT -> (collection as Collection).toUIntArray().asList() +// +// ULONG -> (collection as Collection).toULongArray().asList() + + NULLABLE_BOOLEAN -> BooleanArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toBooleanArray(), + ).asPrimitiveArrayList() + + NULLABLE_BYTE -> ByteArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toByteArray(), + ).asPrimitiveArrayList() + + NULLABLE_SHORT -> ShortArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toShortArray(), + ).asPrimitiveArrayList() + + NULLABLE_INT -> IntArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toIntArray(), + ).asPrimitiveArrayList() + + NULLABLE_LONG -> LongArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toLongArray(), + ).asPrimitiveArrayList() + + NULLABLE_FLOAT -> FloatArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toFloatArray(), + ).asPrimitiveArrayList() + + NULLABLE_DOUBLE -> DoubleArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toDoubleArray(), + ).asPrimitiveArrayList() + + NULLABLE_CHAR -> CharArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toCharArray(), + ).asPrimitiveArrayList() + +// NULLABLE_UBYTE -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUByteArray() +// .asList() +// +// NULLABLE_USHORT -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUShortArray() +// .asList() +// +// NULLABLE_UINT -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUIntArray() +// .asList() +// +// NULLABLE_ULONG -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toULongArray() +// .asList() + + else -> { + for ((i, it) in collection.withIndex()) { + if (it == null) isNull[i] = true + } + collection.toMutableList() + } + } as MutableList + + return ColumnDataHolderImpl( + list = newList, + distinct = distinct, + zeroValue = zeroValueOf(type) as T, + nullIndices = isNull.indicesWhereTrue(), + strictTypes = strictTypes, + ) + } catch (e: Exception) { + throw IllegalArgumentException("Can't create ColumnDataHolder from $collection and type $type", e) + } +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [array]. + * If [array] is an array of primitives, it will be converted to a primitive array first before being + * wrapped with [asList]. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofBoxedArray( + array: Array, + type: KType, + distinct: Lazy>? = null, + strictTypes: Boolean = false, +): ColumnDataHolder { + try { + val isNull = BooleanArray(array.size) + val list = when (type) { + BOOLEAN -> BooleanArrayList((array as Array).toBooleanArray()).asPrimitiveArrayList() + + BYTE -> ByteArrayList((array as Array).toByteArray()).asPrimitiveArrayList() + + SHORT -> ShortArrayList((array as Array).toShortArray()).asPrimitiveArrayList() + + INT -> IntArrayList((array as Array).toIntArray()).asPrimitiveArrayList() + + LONG -> LongArrayList((array as Array).toLongArray()).asPrimitiveArrayList() + + FLOAT -> FloatArrayList((array as Array).toFloatArray()).asPrimitiveArrayList() + + DOUBLE -> DoubleArrayList((array as Array).toDoubleArray()).asPrimitiveArrayList() + + CHAR -> CharArrayList((array as Array).toCharArray()).asPrimitiveArrayList() + +// UBYTE -> (array as Array).toUByteArray().asList() +// +// USHORT -> (array as Array).toUShortArray().asList() +// +// UINT -> (array as Array).toUIntArray().asList() +// +// ULONG -> (array as Array).toULongArray().asList() + + NULLABLE_BOOLEAN -> BooleanArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toBooleanArray(), + ).asPrimitiveArrayList() + + NULLABLE_BYTE -> ByteArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toByteArray(), + ).asPrimitiveArrayList() + + NULLABLE_SHORT -> ShortArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toShortArray(), + ).asPrimitiveArrayList() + + NULLABLE_INT -> IntArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toIntArray(), + ).asPrimitiveArrayList() + + NULLABLE_LONG -> LongArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toLongArray(), + ).asPrimitiveArrayList() + + NULLABLE_FLOAT -> FloatArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toFloatArray(), + ).asPrimitiveArrayList() + + NULLABLE_DOUBLE -> DoubleArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toDoubleArray(), + ).asPrimitiveArrayList() + + NULLABLE_CHAR -> CharArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toCharArray(), + ).asPrimitiveArrayList() + +// NULLABLE_UBYTE -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUByteArray() +// .asList() +// +// NULLABLE_USHORT -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUShortArray() +// .asList() +// +// NULLABLE_UINT -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUIntArray() +// .asList() +// +// NULLABLE_ULONG -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toULongArray() +// .asList() + + else -> { + for ((i, it) in array.withIndex()) { + if (it == null) isNull[i] = true + } + array.toMutableList() + } + } as MutableList + + return ColumnDataHolderImpl( + list = list, + distinct = distinct, + zeroValue = zeroValueOf(type), + nullIndices = isNull.indicesWhereTrue(), + strictTypes = strictTypes, + ) + } catch (e: Exception) { + throw IllegalArgumentException( + "Can't create ColumnDataHolder from $array and mismatching type $type", + e, + ) + } +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [primitiveArray]. + * [primitiveArray] must be an array of primitives, returns `null` if something goes wrong. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofPrimitiveArray( + primitiveArray: Any, + type: KType, + distinct: Lazy>? = null, + strictTypes: Boolean = false, +): ColumnDataHolder { + val newList = when { + type == BOOLEAN && primitiveArray is BooleanArray -> BooleanArrayList(primitiveArray).asPrimitiveArrayList() + + type == BYTE && primitiveArray is ByteArray -> ByteArrayList(primitiveArray).asPrimitiveArrayList() + + type == SHORT && primitiveArray is ShortArray -> ShortArrayList(primitiveArray).asPrimitiveArrayList() + + type == INT && primitiveArray is IntArray -> IntArrayList(primitiveArray).asPrimitiveArrayList() + + type == LONG && primitiveArray is LongArray -> LongArrayList(primitiveArray).asPrimitiveArrayList() + + type == FLOAT && primitiveArray is FloatArray -> FloatArrayList(primitiveArray).asPrimitiveArrayList() + + type == DOUBLE && primitiveArray is DoubleArray -> DoubleArrayList(primitiveArray).asPrimitiveArrayList() + + type == CHAR && primitiveArray is CharArray -> CharArrayList(primitiveArray).asPrimitiveArrayList() + +// type == UBYTE && primitiveArray is UByteArray -> primitiveArray.asList() +// +// type == USHORT && primitiveArray is UShortArray -> primitiveArray.asList() +// +// type == UINT && primitiveArray is UIntArray -> primitiveArray.asList() +// +// type == ULONG && primitiveArray is ULongArray -> primitiveArray.asList() + + !primitiveArray.isPrimitiveArray -> throw IllegalArgumentException( + "Can't create ColumnDataHolder from non primitive array $primitiveArray and type $type", + ) + + else -> throw IllegalArgumentException( + "Can't create ColumnDataHolder from primitive array $primitiveArray and type $type", + ) + } as MutableList + + return ColumnDataHolderImpl( + list = newList, + distinct = distinct, + zeroValue = zeroValueOf(type), + strictTypes = strictTypes, + ) +} + +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.of( + any: Any, + type: KType, + distinct: Lazy>? = null, + strictTypes: Boolean = false, +): ColumnDataHolder = + when { + any is ColumnDataHolder<*> -> any as ColumnDataHolder + + any.isPrimitiveArray -> ofPrimitiveArray( + primitiveArray = any, + type = type, + distinct = distinct, + strictTypes = strictTypes, + ) + + any.isArray -> ofBoxedArray( + array = any as Array, + type = type, + distinct = distinct, + strictTypes = strictTypes, + ) + + any is Collection<*> -> ofCollection( + collection = any as Collection, + type = type, + distinct = distinct, + strictTypes = strictTypes, + ) + + else -> throw IllegalArgumentException("Can't create ColumnDataHolder from $any and type $type") + } + +internal fun ColumnDataHolder.Companion.empty( + initCapacity: Int = 0, + strictTypes: Boolean = false, +): ColumnDataHolder = + ColumnDataHolderImpl( + list = PrimitiveArrayList(initCapacity) as MutableList, + strictTypes = strictTypes, + ) + +internal fun ColumnDataHolder.Companion.emptyForType( + type: KType, + initCapacity: Int = 0, + strictTypes: Boolean = false, + distinct: Lazy>? = null, +): ColumnDataHolder = + ColumnDataHolderImpl( + list = PrimitiveArrayList.forTypeOrNull( + kType = type.withNullability(false), + initCapacity = initCapacity, + ) as MutableList? ?: mutableListOf(), + distinct = distinct, + zeroValue = zeroValueOf(type), + strictTypes = strictTypes, + ) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt index eac43db02..09fb6c1e1 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.BuildConfig +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.api.dataFrameOf import org.jetbrains.kotlinx.dataframe.impl.isArray @@ -11,10 +12,9 @@ import kotlin.reflect.KType import kotlin.reflect.full.isSubclassOf internal abstract class DataColumnImpl( - protected val values: List, + protected val values: ColumnDataHolder, val name: String, val type: KType, - distinct: Lazy>? = null, ) : DataColumn, DataColumnInternal { @@ -43,11 +43,12 @@ internal abstract class DataColumnImpl( } } - protected val distinct = distinct ?: lazy { values.toSet() } + protected val distinct + get() = values.distinct override fun name() = name - override fun values() = values + override fun values(): List = values.toList() override fun type() = type @@ -70,7 +71,7 @@ internal abstract class DataColumnImpl( override fun hashCode() = hashCode - override operator fun get(range: IntRange) = createWithValues(values.subList(range.first, range.last + 1)) + override operator fun get(range: IntRange) = createWithValues(values[range]) protected abstract fun createWithValues(values: List, hasNulls: Boolean? = null): DataColumn } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt index d07c0b9d0..130f934a9 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.schema @@ -11,22 +12,21 @@ import org.jetbrains.kotlinx.dataframe.impl.createStarProjectedType import org.jetbrains.kotlinx.dataframe.impl.schema.intersectSchemas import org.jetbrains.kotlinx.dataframe.nrow import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema +import org.jetbrains.kotlinx.dataframe.toColumnDataHolder import kotlin.reflect.KType -internal open class FrameColumnImpl constructor( +internal open class FrameColumnImpl( name: String, - values: List>, + values: ColumnDataHolder>, columnSchema: Lazy? = null, - distinct: Lazy>>? = null, ) : DataColumnImpl>( values = values, name = name, type = DataFrame::class.createStarProjectedType(false), - distinct = distinct, ), FrameColumn { - override fun rename(newName: String) = FrameColumnImpl(newName, values, schema, distinct) + override fun rename(newName: String) = FrameColumnImpl(newName, values, schema) override fun defaultValue() = null @@ -37,7 +37,11 @@ internal open class FrameColumnImpl constructor( override fun changeType(type: KType) = throw UnsupportedOperationException() - override fun distinct() = FrameColumnImpl(name, distinct.value.toList(), schema, distinct) + override fun distinct() = FrameColumnImpl( + name = name, + values = toSet().toColumnDataHolder(type, distinct), + columnSchema = schema + ) override val schema: Lazy = columnSchema ?: lazy { values.mapNotNull { it.takeIf { it.nrow > 0 }?.schema() }.intersectSchemas() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt index f758360d1..0ed6aa977 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt @@ -1,27 +1,34 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnResolutionContext import org.jetbrains.kotlinx.dataframe.columns.ValueColumn +import org.jetbrains.kotlinx.dataframe.toColumnDataHolder import kotlin.reflect.KType import kotlin.reflect.full.withNullability internal open class ValueColumnImpl( - values: List, + values: ColumnDataHolder, name: String, type: KType, val defaultValue: T? = null, - distinct: Lazy>? = null, -) : DataColumnImpl(values, name, type, distinct), +) : DataColumnImpl(values, name, type), ValueColumn { - override fun distinct() = ValueColumnImpl(toSet().toList(), name, type, defaultValue, distinct) + override fun distinct() = + ValueColumnImpl( + values = toSet().toColumnDataHolder(type, distinct), + name = name, + type = type, + defaultValue = defaultValue, + ) - override fun rename(newName: String) = ValueColumnImpl(values, newName, type, defaultValue, distinct) + override fun rename(newName: String) = ValueColumnImpl(values, newName, type, defaultValue) - override fun changeType(type: KType) = ValueColumnImpl(values, name, type, defaultValue, distinct) + override fun changeType(type: KType) = ValueColumnImpl(values, name, type, defaultValue) override fun addParent(parent: ColumnGroup<*>): DataColumn = ValueColumnWithParent(parent, this) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt index bb9fcc8ab..7f2f03926 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt @@ -3,6 +3,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyCol import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.ColumnsContainer import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataColumn @@ -92,7 +93,7 @@ internal fun ColumnsContainer.newColumnWithActualType( internal fun computeValues(df: DataFrame, expression: AddExpression): Pair> { var nullable = false - val list = ArrayList(df.nrow) + val list = ColumnDataHolder.empty(df.nrow) df.indices().forEach { val row = AddDataRowImpl(it, df, list) val value = expression(row, row) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt new file mode 100644 index 000000000..df8ddb541 --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/ColumnDataHolder.kt @@ -0,0 +1,129 @@ +@file:OptIn(ExperimentalUnsignedTypes::class) + +package org.jetbrains.kotlinx.dataframe + +import org.jetbrains.kotlinx.dataframe.impl.columns.BOOLEAN +import org.jetbrains.kotlinx.dataframe.impl.columns.BYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.CHAR +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderImpl +import org.jetbrains.kotlinx.dataframe.impl.columns.DOUBLE +import org.jetbrains.kotlinx.dataframe.impl.columns.FLOAT +import org.jetbrains.kotlinx.dataframe.impl.columns.INT +import org.jetbrains.kotlinx.dataframe.impl.columns.LONG +import org.jetbrains.kotlinx.dataframe.impl.columns.SHORT +import org.jetbrains.kotlinx.dataframe.impl.columns.UBYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.UINT +import org.jetbrains.kotlinx.dataframe.impl.columns.ULONG +import org.jetbrains.kotlinx.dataframe.impl.columns.USHORT +import org.jetbrains.kotlinx.dataframe.impl.columns.ofBoxedArray +import org.jetbrains.kotlinx.dataframe.impl.columns.ofCollection +import org.jetbrains.kotlinx.dataframe.impl.columns.ofPrimitiveArray +import kotlin.reflect.KType +import kotlin.reflect.typeOf + +/** + * Represents the contents of a column; however, it may be implemented. + * The default implementation is found at [ColumnDataHolderImpl]. + */ +public interface ColumnDataHolder : List { + + public fun toSet(): Set + + public operator fun get(range: IntRange): List + + public fun add(element: T) + + public fun add(boolean: Boolean) + + public fun add(byte: Byte) + + public fun add(short: Short) + + public fun add(int: Int) + + public fun add(long: Long) + + public fun add(float: Float) + + public fun add(double: Double) + + public fun add(char: Char) + + public operator fun set(index: Int, value: T) + + public operator fun set(index: Int, value: Boolean) + + public operator fun set(index: Int, value: Byte) + + public operator fun set(index: Int, value: Short) + + public operator fun set(index: Int, value: Int) + + public operator fun set(index: Int, value: Long) + + public operator fun set(index: Int, value: Float) + + public operator fun set(index: Int, value: Double) + + public operator fun set(index: Int, value: Char) + + public fun isNull(index: Int): Boolean + + public fun hasNulls(): Boolean + + public fun canAddPrimitively(element: Any?): Boolean + + public val distinct: Lazy> + + public val usesPrimitiveArrayList: Boolean + + public companion object +} + +public fun Collection.toColumnDataHolder(type: KType, distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofCollection(this, type, distinct) + +public inline fun Collection.toColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + this.toColumnDataHolder(typeOf(), distinct) + +public fun Array.toColumnDataHolder(type: KType, distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofBoxedArray(this, type, distinct) + +public inline fun Array.toColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + this.toColumnDataHolder(typeOf(), distinct) + +public fun BooleanArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, BOOLEAN, distinct) + +public fun ByteArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, BYTE, distinct) + +public fun ShortArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, SHORT, distinct) + +public fun IntArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, INT, distinct) + +public fun LongArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, LONG, distinct) + +public fun FloatArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, FLOAT, distinct) + +public fun DoubleArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, DOUBLE, distinct) + +public fun CharArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, CHAR, distinct) + +public fun UByteArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, UBYTE, distinct) + +public fun UShortArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, USHORT, distinct) + +public fun UIntArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, UINT, distinct) + +public fun ULongArray.asColumnDataHolder(distinct: Lazy>? = null): ColumnDataHolder = + ColumnDataHolder.ofPrimitiveArray(this, ULONG, distinct) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt index b61c9ae2d..aacf8a7f7 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt @@ -21,6 +21,8 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.FrameColumnImpl import org.jetbrains.kotlinx.dataframe.impl.columns.ValueColumnImpl import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.guessColumnType +import org.jetbrains.kotlinx.dataframe.impl.columns.ofCollection +import org.jetbrains.kotlinx.dataframe.impl.columns.ofBoxedArray import org.jetbrains.kotlinx.dataframe.impl.columns.toColumnKind import org.jetbrains.kotlinx.dataframe.impl.getValuesType import org.jetbrains.kotlinx.dataframe.impl.splitByIndices @@ -42,6 +44,49 @@ public interface DataColumn : BaseColumn { public companion object { + public fun createValueColumn( + name: String, + values: ColumnDataHolder, + type: KType, + defaultValue: T? = null, + ): ValueColumn = ValueColumnImpl(values, name, type, defaultValue) + + public fun createValueColumn(name: String, values: BooleanArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ByteArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ShortArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: IntArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: LongArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: FloatArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: DoubleArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: CharArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UByteArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UShortArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: UIntArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + + public fun createValueColumn(name: String, values: ULongArray): ValueColumn = + createValueColumn(name, values.asColumnDataHolder(), typeOf()) + /** * Creates [ValueColumn] using given [name], [values] and [type]. * @@ -56,7 +101,15 @@ public interface DataColumn : BaseColumn { type: KType, infer: Infer = Infer.None, defaultValue: T? = null, - ): ValueColumn = ValueColumnImpl(values, name, getValuesType(values, type, infer), defaultValue) + ): ValueColumn { + val valueType = getValuesType(values, type, infer) + return createValueColumn( + name = name, + values = ColumnDataHolder.ofCollection(values, valueType), + type = valueType, + defaultValue = defaultValue, + ) + } /** * Creates [ValueColumn] using given [name], [values] and reified column [type]. @@ -74,25 +127,56 @@ public interface DataColumn : BaseColumn { infer: Infer = Infer.None, ): ValueColumn = createValueColumn( - name, - values, - getValuesType( - values, - typeOf(), - infer, + name = name, + values = values, + type = getValuesType( + values = values, + type = typeOf(), + infer = infer, ), ) + public fun createValueColumn( + name: String, + values: Array, + type: KType, + infer: Infer = Infer.None, + defaultValue: T? = null, + ): ValueColumn { + val valueType = getValuesType(values.asList(), type, infer) + return createValueColumn( + name = name, + values = ColumnDataHolder.ofBoxedArray(values, valueType), + type = valueType, + defaultValue = defaultValue, + ) + } + + public inline fun createValueColumn( + name: String, + values: Array, + infer: Infer = Infer.None, + ): ValueColumn = + createValueColumn( + name = name, + values = values, + type = getValuesType(values.asList(), typeOf(), infer), + ) + public fun createColumnGroup(name: String, df: DataFrame): ColumnGroup = ColumnGroupImpl(name, df) public fun createFrameColumn(name: String, df: DataFrame, startIndices: Iterable): FrameColumn = - FrameColumnImpl(name, df.splitByIndices(startIndices.asSequence()).toList(), lazy { df.schema() }) + FrameColumnImpl( + name, + df.splitByIndices(startIndices.asSequence()).toList().toColumnDataHolder(), + lazy { df.schema() }, + ) public fun createFrameColumn( name: String, groups: List>, schema: Lazy? = null, - ): FrameColumn = FrameColumnImpl(name, groups, schema) + ): FrameColumn = FrameColumnImpl(name, groups.toColumnDataHolder(), schema) public fun createWithTypeInference( name: String, diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/parse.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/parse.kt index f41e334b3..d35ae9cef 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/parse.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/parse.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlinx.dataframe.typeClass import java.time.format.DateTimeFormatter import java.util.Locale import kotlin.reflect.KProperty +import kotlin.reflect.KType public val DataFrame.Companion.parser: GlobalParserOptions get() = Parsers @@ -44,6 +45,7 @@ public data class ParserOptions( val dateTimeFormatter: DateTimeFormatter? = null, val dateTimePattern: String? = null, val nullStrings: Set? = null, + val parsersToSkip: Set = emptySet(), ) { internal fun getDateTimeFormatter(): DateTimeFormatter? = when { diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt index 2d7b7e7d7..961117529 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/ColumnDataCollector.kt @@ -2,11 +2,14 @@ package org.jetbrains.kotlinx.dataframe.impl import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.api.concat import org.jetbrains.kotlinx.dataframe.api.toDataFrame +import org.jetbrains.kotlinx.dataframe.impl.columns.empty +import org.jetbrains.kotlinx.dataframe.impl.columns.emptyForType import org.jetbrains.kotlinx.dataframe.impl.columns.guessColumnType import kotlin.reflect.KClass import kotlin.reflect.KType @@ -21,6 +24,22 @@ internal interface DataCollector { public fun add(value: T) + public fun add(element: Boolean) + + public fun add(element: Byte) + + public fun add(element: Short) + + public fun add(element: Int) + + public fun add(element: Long) + + public fun add(element: Float) + + public fun add(element: Double) + + public fun add(element: Char) + public fun toColumn(name: String): DataColumn } @@ -28,7 +47,7 @@ internal abstract class DataCollectorBase(initCapacity: Int) : DataCollector< override var hasNulls = false - override val data = ArrayList(initCapacity) + override val data = ColumnDataHolder.empty(initCapacity) val values: List get() = data @@ -38,6 +57,22 @@ internal abstract class DataCollectorBase(initCapacity: Int) : DataCollector< data.add(value) } + override fun add(element: Boolean) = data.add(element) + + override fun add(element: Byte) = data.add(element) + + override fun add(element: Short) = data.add(element) + + override fun add(element: Int) = data.add(element) + + override fun add(element: Long) = data.add(element) + + override fun add(element: Float) = data.add(element) + + override fun add(element: Double) = data.add(element) + + override fun add(element: Char) = data.add(element) + protected fun createColumn(name: String, type: KType): DataColumn { val classifier = type.classifier as KClass<*> if (classifier.isSubclassOf(DataFrame::class) && !hasNulls) { @@ -62,13 +97,24 @@ internal class TypedColumnDataCollector(initCapacity: Int = 0, val type: KTyp internal val kclass = type.jvmErasure + override val data: ColumnDataHolder = + ColumnDataHolder.emptyForType( + type = type, + initCapacity = initCapacity, + ) + override fun add(value: T?) { - if (checkTypes && value != null && !value.javaClass.kotlin.isSubclassOf(kclass)) { + if (data.canAddPrimitively(value) || + !checkTypes || + value == null || + value.javaClass.kotlin.isSubclassOf(kclass) + ) { + super.add(value) + } else { throw IllegalArgumentException( "Can not add value of class ${value.javaClass.kotlin.qualifiedName} to column of type $type. Value = $value", ) } - super.add(value) } override fun toColumn(name: String) = createColumn(name, type) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt index 1e7f8c18d..9425dd859 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt @@ -1,8 +1,12 @@ package org.jetbrains.kotlinx.dataframe.impl.api import kotlinx.datetime.Instant +import kotlinx.datetime.LocalDate +import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.LocalTime import kotlinx.datetime.toKotlinLocalDate import kotlinx.datetime.toKotlinLocalDateTime +import kotlinx.datetime.toKotlinLocalTime import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataColumn @@ -31,9 +35,6 @@ import org.jetbrains.kotlinx.dataframe.typeClass import java.net.URL import java.text.NumberFormat import java.text.ParsePosition -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatterBuilder import java.util.Locale @@ -43,6 +44,9 @@ import kotlin.reflect.full.withNullability import kotlin.reflect.jvm.jvmErasure import kotlin.reflect.typeOf import kotlin.time.Duration +import java.time.LocalDate as JavaLocalDate +import java.time.LocalDateTime as JavaLocalDateTime +import java.time.LocalTime as JavaLocalTime internal interface StringParser { fun toConverter(options: ParserOptions?): TypeConverter @@ -132,18 +136,21 @@ internal object Parsers : GlobalParserOptions { resetToDefault() } - private fun String.toLocalDateTimeOrNull(formatter: DateTimeFormatter?): LocalDateTime? { + private fun String.toJavaLocalDateTimeOrNull(formatter: DateTimeFormatter?): JavaLocalDateTime? { if (formatter != null) { - return catchSilent { java.time.LocalDateTime.parse(this, formatter) } + return catchSilent { JavaLocalDateTime.parse(this, formatter) } } else { - catchSilent { LocalDateTime.parse(this) }?.let { return it } + catchSilent { JavaLocalDateTime.parse(this) }?.let { return it } for (format in formatters) { - catchSilent { java.time.LocalDateTime.parse(this, format) }?.let { return it } + catchSilent { JavaLocalDateTime.parse(this, format) }?.let { return it } } } return null } + private fun String.toLocalDateTimeOrNull(formatter: DateTimeFormatter?): LocalDateTime? = + toJavaLocalDateTimeOrNull(formatter)?.toKotlinLocalDateTime() + private fun String.toUrlOrNull(): URL? = if (isURL(this)) catchSilent { URL(this) } else null private fun String.toBooleanOrNull() = @@ -157,30 +164,36 @@ internal object Parsers : GlobalParserOptions { else -> null } - private fun String.toLocalDateOrNull(formatter: DateTimeFormatter?): LocalDate? { + private fun String.toJavaLocalDateOrNull(formatter: DateTimeFormatter?): JavaLocalDate? { if (formatter != null) { - return catchSilent { java.time.LocalDate.parse(this, formatter) } + return catchSilent { JavaLocalDate.parse(this, formatter) } } else { - catchSilent { LocalDate.parse(this) }?.let { return it } + catchSilent { JavaLocalDate.parse(this) }?.let { return it } for (format in formatters) { - catchSilent { java.time.LocalDate.parse(this, format) }?.let { return it } + catchSilent { JavaLocalDate.parse(this, format) }?.let { return it } } } return null } - private fun String.toLocalTimeOrNull(formatter: DateTimeFormatter?): LocalTime? { + private fun String.toLocalDateOrNull(formatter: DateTimeFormatter?): LocalDate? = + toJavaLocalDateOrNull(formatter)?.toKotlinLocalDate() + + private fun String.toJavaLocalTimeOrNull(formatter: DateTimeFormatter?): JavaLocalTime? { if (formatter != null) { - return catchSilent { LocalTime.parse(this, formatter) } + return catchSilent { JavaLocalTime.parse(this, formatter) } } else { - catchSilent { LocalTime.parse(this) }?.let { return it } + catchSilent { JavaLocalTime.parse(this) }?.let { return it } for (format in formatters) { - catchSilent { LocalTime.parse(this, format) }?.let { return it } + catchSilent { JavaLocalTime.parse(this, format) }?.let { return it } } } return null } + private fun String.toLocalTimeOrNull(formatter: DateTimeFormatter?): LocalTime? = + toJavaLocalTimeOrNull(formatter)?.toKotlinLocalTime() + private fun String.parseDouble(format: NumberFormat) = when (uppercase(Locale.getDefault())) { "NAN" -> Double.NaN @@ -234,41 +247,47 @@ internal object Parsers : GlobalParserOptions { // kotlinx.datetime.Instant stringParser { catchSilent { Instant.parse(it) } }, // java.time.Instant - stringParser { catchSilent { java.time.Instant.parse(it) } }, +// stringParser { catchSilent { JavaInstant.parse(it) } }, // kotlinx.datetime.LocalDateTime - stringParserWithOptions { options -> - val formatter = options?.getDateTimeFormatter() - val parser = { it: String -> it.toLocalDateTimeOrNull(formatter)?.toKotlinLocalDateTime() } - parser - }, - // java.time.LocalDateTime stringParserWithOptions { options -> val formatter = options?.getDateTimeFormatter() val parser = { it: String -> it.toLocalDateTimeOrNull(formatter) } parser }, + // java.time.LocalDateTime +// stringParserWithOptions { options -> +// val formatter = options?.getDateTimeFormatter() +// val parser = { it: String -> it.toJavaLocalDateTimeOrNull(formatter) } +// parser +// }, // kotlinx.datetime.LocalDate - stringParserWithOptions { options -> - val formatter = options?.getDateTimeFormatter() - val parser = { it: String -> it.toLocalDateOrNull(formatter)?.toKotlinLocalDate() } - parser - }, - // java.time.LocalDate stringParserWithOptions { options -> val formatter = options?.getDateTimeFormatter() val parser = { it: String -> it.toLocalDateOrNull(formatter) } parser }, + // java.time.LocalDate +// stringParserWithOptions { options -> +// val formatter = options?.getDateTimeFormatter() +// val parser = { it: String -> it.toJavaLocalDateOrNull(formatter) } +// parser +// }, // kotlin.time.Duration stringParser { catchSilent { Duration.parse(it) } }, // java.time.Duration - stringParser { catchSilent { java.time.Duration.parse(it) } }, - // java.time.LocalTime +// stringParser { catchSilent { JavaDuration.parse(it) } }, + // kotlinx.datetime.LocalTime stringParserWithOptions { options -> val formatter = options?.getDateTimeFormatter() val parser = { it: String -> it.toLocalTimeOrNull(formatter) } parser }, + // java.time.LocalTime +// stringParserWithOptions { options -> +// val formatter = options?.getDateTimeFormatter() +// val parser = { it: String -> it.toJavaLocalTimeOrNull(formatter) } +// parser +// }, // java.net.URL stringParser { it.toUrlOrNull() }, // Double, with explicit number format or taken from current locale @@ -334,17 +353,22 @@ internal object Parsers : GlobalParserOptions { internal fun DataColumn.tryParseImpl(options: ParserOptions?): DataColumn<*> { var parserId = 0 val parsedValues = mutableListOf() - var hasNulls: Boolean - var hasNotNulls: Boolean - var nullStringParsed: Boolean + var hasNulls: Boolean = false + var hasNotNulls: Boolean = false + var nullStringParsed: Boolean = false val nulls = options?.nullStrings ?: Parsers.nulls do { - val parser = Parsers[parserId].applyOptions(options) + val retrievedParser = Parsers[parserId] + if (options?.parsersToSkip?.contains(retrievedParser.type) == true) { + parserId++ + continue + } + val parser = retrievedParser.applyOptions(options) parsedValues.clear() hasNulls = false hasNotNulls = false nullStringParsed = false - for (str in values) { + for (str in this) { when { str == null -> { parsedValues.add(null) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/BigPrimitiveArrayList.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/BigPrimitiveArrayList.kt new file mode 100644 index 000000000..d378a43f0 --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/BigPrimitiveArrayList.kt @@ -0,0 +1,708 @@ +package org.jetbrains.kotlinx.dataframe.impl.columns + +import it.unimi.dsi.fastutil.BigList +import it.unimi.dsi.fastutil.BigListIterator +import it.unimi.dsi.fastutil.booleans.BooleanBigArrayBigList +import it.unimi.dsi.fastutil.booleans.BooleanBigListIterator +import it.unimi.dsi.fastutil.bytes.ByteBigArrayBigList +import it.unimi.dsi.fastutil.bytes.ByteBigListIterator +import it.unimi.dsi.fastutil.chars.CharBigArrayBigList +import it.unimi.dsi.fastutil.chars.CharBigListIterator +import it.unimi.dsi.fastutil.doubles.DoubleBigArrayBigList +import it.unimi.dsi.fastutil.doubles.DoubleBigListIterator +import it.unimi.dsi.fastutil.floats.FloatBigArrayBigList +import it.unimi.dsi.fastutil.floats.FloatBigListIterator +import it.unimi.dsi.fastutil.ints.IntBigArrayBigList +import it.unimi.dsi.fastutil.ints.IntBigListIterator +import it.unimi.dsi.fastutil.longs.LongBigArrayBigList +import it.unimi.dsi.fastutil.longs.LongBigListIterator +import it.unimi.dsi.fastutil.shorts.ShortBigArrayBigList +import it.unimi.dsi.fastutil.shorts.ShortBigListIterator +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.BOOLEAN +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.BYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.CHAR +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.DOUBLE +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.FLOAT +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.INT +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.LONG +import org.jetbrains.kotlinx.dataframe.impl.columns.BigPrimitiveArrayList.State.SHORT +import kotlin.reflect.KType +import kotlin.reflect.typeOf +import org.jetbrains.kotlinx.dataframe.impl.columns.BOOLEAN as BOOLEAN_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.BYTE as BYTE_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.CHAR as CHAR_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.DOUBLE as DOUBLE_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.FLOAT as FLOAT_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.INT as INT_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.LONG as LONG_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.SHORT as SHORT_TYPE + +internal class BigPrimitiveArrayList private constructor(arrayList: BigList?, state: State?) : BigList { + + companion object { + fun forTypeOrNull(kType: KType, initCapacity: Long = 0): BigPrimitiveArrayList? { + return when (kType) { + BOOLEAN_TYPE -> BigPrimitiveArrayList(BOOLEAN, initCapacity) + BYTE_TYPE -> BigPrimitiveArrayList(BYTE, initCapacity) + CHAR_TYPE -> BigPrimitiveArrayList(CHAR, initCapacity) + SHORT_TYPE -> BigPrimitiveArrayList(SHORT, initCapacity) + INT_TYPE -> BigPrimitiveArrayList(INT, initCapacity) + LONG_TYPE -> BigPrimitiveArrayList(LONG, initCapacity) + FLOAT_TYPE -> BigPrimitiveArrayList(FLOAT, initCapacity) + DOUBLE_TYPE -> BigPrimitiveArrayList(DOUBLE, initCapacity) + else -> return null + } as BigPrimitiveArrayList + } + + inline fun forTypeOrNull(initCapacity: Long = 0): BigPrimitiveArrayList? = + forTypeOrNull(typeOf(), initCapacity) + + fun forType(kType: KType, initCapacity: Long = 0): BigPrimitiveArrayList = + forTypeOrNull(kType, initCapacity) ?: throw IllegalArgumentException("Unsupported type: $kType") + + inline fun forType(initCapacity: Long = 0): BigPrimitiveArrayList = + forType(typeOf(), initCapacity) + } + + var initCapacity = arrayList?.size64() ?: 0L + + constructor() : this( + arrayList = null, + state = null, + ) + + constructor(initCapacity: Long) : this( + arrayList = null, + state = null, + ) { + this.initCapacity = initCapacity + } + + constructor(state: State?) : this( + arrayList = when (state) { + BOOLEAN -> BooleanBigArrayBigList() + BYTE -> ByteBigArrayBigList() + CHAR -> CharBigArrayBigList() + SHORT -> ShortBigArrayBigList() + INT -> IntBigArrayBigList() + LONG -> LongBigArrayBigList() + FLOAT -> FloatBigArrayBigList() + DOUBLE -> DoubleBigArrayBigList() + null -> null + } as BigList?, + state = state, + ) + + constructor(state: State?, initCapacity: Long) : this( + arrayList = when (state) { + BOOLEAN -> BooleanBigArrayBigList(initCapacity) + BYTE -> ByteBigArrayBigList(initCapacity) + CHAR -> CharBigArrayBigList(initCapacity) + SHORT -> ShortBigArrayBigList(initCapacity) + INT -> IntBigArrayBigList(initCapacity) + LONG -> LongBigArrayBigList(initCapacity) + FLOAT -> FloatBigArrayBigList(initCapacity) + DOUBLE -> DoubleBigArrayBigList(initCapacity) + null -> null + } as BigList?, + state = state, + ) + + constructor(booleans: BooleanBigArrayBigList) : this( + arrayList = booleans as BigList, + state = BOOLEAN, + ) + + constructor(bytes: ByteBigArrayBigList) : this( + arrayList = bytes as BigList, + state = BYTE, + ) + + constructor(chars: CharBigArrayBigList) : this( + arrayList = chars as BigList, + state = CHAR, + ) + + constructor(shorts: ShortBigArrayBigList) : this( + arrayList = shorts as BigList, + state = SHORT, + ) + + constructor(ints: IntBigArrayBigList) : this( + arrayList = ints as BigList, + state = INT, + ) + + constructor(longs: LongBigArrayBigList) : this( + arrayList = longs as BigList, + state = LONG, + ) + + constructor(floats: FloatBigArrayBigList) : this( + arrayList = floats as BigList, + state = FLOAT, + ) + + constructor(doubles: DoubleBigArrayBigList) : this( + arrayList = doubles as BigList, + state = DOUBLE, + ) + + enum class State { + BOOLEAN, + BYTE, + CHAR, + SHORT, + INT, + LONG, + FLOAT, + DOUBLE, + } + + internal var arrayList: BigList? = arrayList + private set + + internal var state = state + private set + + private fun initializeArrayList(state: State) { + arrayList = when (state) { + BOOLEAN -> BooleanBigArrayBigList(initCapacity) + BYTE -> ByteBigArrayBigList(initCapacity) + CHAR -> CharBigArrayBigList(initCapacity) + SHORT -> ShortBigArrayBigList(initCapacity) + INT -> IntBigArrayBigList(initCapacity) + LONG -> LongBigArrayBigList(initCapacity) + FLOAT -> FloatBigArrayBigList(initCapacity) + DOUBLE -> DoubleBigArrayBigList(initCapacity) + } as BigList + this.state = state + } + + override fun listIterator(): BigListIterator = listIterator(0) + + override fun listIterator(index: Long): BigListIterator = + object : BigListIterator { + private var it = arrayList?.listIterator(index) + + override fun add(element: T) { + when (state) { + BOOLEAN -> (it as BooleanBigListIterator).add(element as Boolean) + + BYTE -> (it as ByteBigListIterator).add(element as Byte) + + CHAR -> (it as CharBigListIterator).add(element as Char) + + SHORT -> (it as ShortBigListIterator).add(element as Short) + + INT -> (it as IntBigListIterator).add(element as Int) + + LONG -> (it as LongBigListIterator).add(element as Long) + + FLOAT -> (it as FloatBigListIterator).add(element as Float) + + DOUBLE -> (it as DoubleBigListIterator).add(element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + it = arrayList!!.listIterator(index) + add(element) + } + } + } + + override fun hasNext(): Boolean = it?.hasNext() ?: false + + override fun hasPrevious(): Boolean = it?.hasPrevious() ?: false + + override fun next(): T = it?.next() ?: error("No next element") + + override fun nextIndex(): Long = it?.nextIndex() ?: -1L + + override fun previous(): T = it?.previous() ?: error("No previous element") + + override fun previousIndex(): Long = it?.previousIndex() ?: -1L + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "KotlinConstantConditions") + override fun remove() { + when (val it = it) { + is BigListIterator<*> -> it.remove() + is java.util.Iterator<*> -> it.remove() + null -> error("No element to remove") + else -> throw UnsupportedOperationException() + } + } + + override fun set(element: T) { + when (state) { + BOOLEAN -> (it as BooleanBigListIterator).set(element as Boolean) + + BYTE -> (it as ByteBigListIterator).set(element as Byte) + + CHAR -> (it as CharBigListIterator).set(element as Char) + + SHORT -> (it as ShortBigListIterator).set(element as Short) + + INT -> (it as IntBigListIterator).set(element as Int) + + LONG -> (it as LongBigListIterator).set(element as Long) + + FLOAT -> (it as FloatBigListIterator).set(element as Float) + + DOUBLE -> (it as DoubleBigListIterator).set(element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + it = arrayList!!.listIterator(index) + set(element) + } + } + } + } + + override fun iterator(): MutableIterator = listIterator() + + override fun lastIndexOf(element: Any?): Long = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).lastIndexOf(element as Boolean) + BYTE -> (arrayList as ByteBigArrayBigList).lastIndexOf(element as Byte) + CHAR -> (arrayList as CharBigArrayBigList).lastIndexOf(element as Char) + SHORT -> (arrayList as ShortBigArrayBigList).lastIndexOf(element as Short) + INT -> (arrayList as IntBigArrayBigList).lastIndexOf(element as Int) + LONG -> (arrayList as LongBigArrayBigList).lastIndexOf(element as Long) + FLOAT -> (arrayList as FloatBigArrayBigList).lastIndexOf(element as Float) + DOUBLE -> (arrayList as DoubleBigArrayBigList).lastIndexOf(element as Double) + null -> error("List is not initialized") + } + + @Suppress("UNCHECKED_CAST") + override fun add(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).add(element as Boolean) + + BYTE -> (arrayList as ByteBigArrayBigList).add(element as Byte) + + CHAR -> (arrayList as CharBigArrayBigList).add(element as Char) + + SHORT -> (arrayList as ShortBigArrayBigList).add(element as Short) + + INT -> (arrayList as IntBigArrayBigList).add(element as Int) + + LONG -> (arrayList as LongBigArrayBigList).add(element as Long) + + FLOAT -> (arrayList as FloatBigArrayBigList).add(element as Float) + + DOUBLE -> (arrayList as DoubleBigArrayBigList).add(element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + add(element) + } + } + + override fun add(index: Long, element: T) { + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).add(index, element as Boolean) + + BYTE -> (arrayList as ByteBigArrayBigList).add(index, element as Byte) + + CHAR -> (arrayList as CharBigArrayBigList).add(index, element as Char) + + SHORT -> (arrayList as ShortBigArrayBigList).add(index, element as Short) + + INT -> (arrayList as IntBigArrayBigList).add(index, element as Int) + + LONG -> (arrayList as LongBigArrayBigList).add(index, element as Long) + + FLOAT -> (arrayList as FloatBigArrayBigList).add(index, element as Float) + + DOUBLE -> (arrayList as DoubleBigArrayBigList).add(index, element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + add(index, element) + } + } + } + + @Suppress("UNCHECKED_CAST") + override fun addAll(index: Long, elements: Collection): Boolean = + if (elements.isEmpty()) { + false + } else { + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).addAll(index, elements as Collection) + + BYTE -> (arrayList as ByteBigArrayBigList).addAll(index, elements as Collection) + + CHAR -> (arrayList as CharBigArrayBigList).addAll(index, elements as Collection) + + SHORT -> (arrayList as ShortBigArrayBigList).addAll(index, elements as Collection) + + INT -> (arrayList as IntBigArrayBigList).addAll(index, elements as Collection) + + LONG -> (arrayList as LongBigArrayBigList).addAll(index, elements as Collection) + + FLOAT -> (arrayList as FloatBigArrayBigList).addAll(index, elements as Collection) + + DOUBLE -> (arrayList as DoubleBigArrayBigList).addAll(index, elements as Collection) + + null -> { + when (elements.first()) { + is Boolean -> initializeArrayList(BOOLEAN) + + is Byte -> initializeArrayList(BYTE) + + is Char -> initializeArrayList(CHAR) + + is Short -> initializeArrayList(SHORT) + + is Int -> initializeArrayList(INT) + + is Long -> initializeArrayList(LONG) + + is Float -> initializeArrayList(FLOAT) + + is Double -> initializeArrayList(DOUBLE) + + else -> throw IllegalArgumentException( + "Unsupported element type: ${elements.first()::class}", + ) + } + addAll(index, elements) + } + } + } + + @Suppress("UNCHECKED_CAST") + override fun addAll(elements: Collection): Boolean = + if (elements.isEmpty()) { + false + } else { + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).addAll(elements as Collection) + + BYTE -> (arrayList as ByteBigArrayBigList).addAll(elements as Collection) + + CHAR -> (arrayList as CharBigArrayBigList).addAll(elements as Collection) + + SHORT -> (arrayList as ShortBigArrayBigList).addAll(elements as Collection) + + INT -> (arrayList as IntBigArrayBigList).addAll(elements as Collection) + + LONG -> (arrayList as LongBigArrayBigList).addAll(elements as Collection) + + FLOAT -> (arrayList as FloatBigArrayBigList).addAll(elements as Collection) + + DOUBLE -> (arrayList as DoubleBigArrayBigList).addAll(elements as Collection) + + null -> { + when (elements.first()) { + is Boolean -> initializeArrayList(BOOLEAN) + + is Byte -> initializeArrayList(BYTE) + + is Char -> initializeArrayList(CHAR) + + is Short -> initializeArrayList(SHORT) + + is Int -> initializeArrayList(INT) + + is Long -> initializeArrayList(LONG) + + is Float -> initializeArrayList(FLOAT) + + is Double -> initializeArrayList(DOUBLE) + + else -> throw IllegalArgumentException( + "Unsupported element type: ${elements.first()::class}", + ) + } + addAll(elements) + true + } + } + } + + fun canAdd(element: Any): Boolean = + when (state) { + BOOLEAN -> element is Boolean + + BYTE -> element is Byte + + CHAR -> element is Char + + SHORT -> element is Short + + INT -> element is Int + + LONG -> element is Long + + FLOAT -> element is Float + + DOUBLE -> element is Double + + null -> + element is Boolean || + element is Byte || + element is Char || + element is Short || + element is Int || + element is Long || + element is Float || + element is Double + } + + override fun size64(): Long = arrayList?.size64() ?: 0L + + override fun size(size: Long) { + if (state == null) { + initCapacity = size + } else { + arrayList!!.size(size) + } + } + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun clear() = (arrayList as java.util.Collection<*>).clear() + + @Suppress("UNCHECKED_CAST") + override fun get(index: Long): T = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).getBoolean(index) + BYTE -> (arrayList as ByteBigArrayBigList).getByte(index) + CHAR -> (arrayList as CharBigArrayBigList).getChar(index) + SHORT -> (arrayList as ShortBigArrayBigList).getShort(index) + INT -> (arrayList as IntBigArrayBigList).getInt(index) + LONG -> (arrayList as LongBigArrayBigList).getLong(index) + FLOAT -> (arrayList as FloatBigArrayBigList).getFloat(index) + DOUBLE -> (arrayList as DoubleBigArrayBigList).getDouble(index) + else -> throw IndexOutOfBoundsException("Index: $index, Size: $size") + } as T + + override fun isEmpty(): Boolean = arrayList?.isEmpty() ?: true + + override fun indexOf(element: Any?): Long = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).indexOf(element as Boolean) + BYTE -> (arrayList as ByteBigArrayBigList).indexOf(element as Byte) + CHAR -> (arrayList as CharBigArrayBigList).indexOf(element as Char) + SHORT -> (arrayList as ShortBigArrayBigList).indexOf(element as Short) + INT -> (arrayList as IntBigArrayBigList).indexOf(element as Int) + LONG -> (arrayList as LongBigArrayBigList).indexOf(element as Long) + FLOAT -> (arrayList as FloatBigArrayBigList).indexOf(element as Float) + DOUBLE -> (arrayList as DoubleBigArrayBigList).indexOf(element as Double) + null -> -1 + } + + @Suppress("UNCHECKED_CAST") + override fun containsAll(elements: Collection): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).containsAll(elements as Collection) + BYTE -> (arrayList as ByteBigArrayBigList).containsAll(elements as Collection) + CHAR -> (arrayList as CharBigArrayBigList).containsAll(elements as Collection) + SHORT -> (arrayList as ShortBigArrayBigList).containsAll(elements as Collection) + INT -> (arrayList as IntBigArrayBigList).containsAll(elements as Collection) + LONG -> (arrayList as LongBigArrayBigList).containsAll(elements as Collection) + FLOAT -> (arrayList as FloatBigArrayBigList).containsAll(elements as Collection) + DOUBLE -> (arrayList as DoubleBigArrayBigList).containsAll(elements as Collection) + null -> elements.isEmpty() + } + + override fun contains(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).contains(element as Boolean) + BYTE -> (arrayList as ByteBigArrayBigList).contains(element as Byte) + CHAR -> (arrayList as CharBigArrayBigList).contains(element as Char) + SHORT -> (arrayList as ShortBigArrayBigList).contains(element as Short) + INT -> (arrayList as IntBigArrayBigList).contains(element as Int) + LONG -> (arrayList as LongBigArrayBigList).contains(element as Long) + FLOAT -> (arrayList as FloatBigArrayBigList).contains(element as Float) + DOUBLE -> (arrayList as DoubleBigArrayBigList).contains(element as Double) + null -> false + } + + @Suppress("UNCHECKED_CAST") + override fun remove(index: Long): T = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).removeBoolean(index) + BYTE -> (arrayList as ByteBigArrayBigList).removeByte(index) + CHAR -> (arrayList as CharBigArrayBigList).removeChar(index) + SHORT -> (arrayList as ShortBigArrayBigList).removeShort(index) + INT -> (arrayList as IntBigArrayBigList).removeInt(index) + LONG -> (arrayList as LongBigArrayBigList).removeLong(index) + FLOAT -> (arrayList as FloatBigArrayBigList).removeFloat(index) + DOUBLE -> (arrayList as DoubleBigArrayBigList).removeDouble(index) + null -> error("List is not initialized") + } as T + + @Suppress("UNCHECKED_CAST") + override fun subList(fromIndex: Long, toIndex: Long): BigList = + when (state) { + BOOLEAN -> BooleanBigArrayBigList( + (arrayList as BooleanBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + BYTE -> ByteBigArrayBigList( + (arrayList as ByteBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + CHAR -> CharBigArrayBigList( + (arrayList as CharBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + SHORT -> ShortBigArrayBigList( + (arrayList as ShortBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + INT -> IntBigArrayBigList( + (arrayList as IntBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + LONG -> LongBigArrayBigList( + (arrayList as LongBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + FLOAT -> FloatBigArrayBigList( + (arrayList as FloatBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + DOUBLE -> DoubleBigArrayBigList( + (arrayList as DoubleBigArrayBigList).subList(fromIndex, toIndex), + ).asBigPrimitiveArrayList() + + null -> error("List is not initialized") + } as BigPrimitiveArrayList + + @Suppress("UNCHECKED_CAST") + override fun set(index: Long, element: T): T = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).set(index, element as Boolean) + + BYTE -> (arrayList as ByteBigArrayBigList).set(index, element as Byte) + + CHAR -> (arrayList as CharBigArrayBigList).set(index, element as Char) + + SHORT -> (arrayList as ShortBigArrayBigList).set(index, element as Short) + + INT -> (arrayList as IntBigArrayBigList).set(index, element as Int) + + LONG -> (arrayList as LongBigArrayBigList).set(index, element as Long) + + FLOAT -> (arrayList as FloatBigArrayBigList).set(index, element as Float) + + DOUBLE -> (arrayList as DoubleBigArrayBigList).set(index, element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + set(index, element) + } + } as T + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun retainAll(elements: Collection): Boolean = + (arrayList as java.util.Collection<*>?)?.retainAll(elements) ?: false + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun removeAll(elements: Collection): Boolean = + (arrayList as java.util.Collection<*>?)?.removeAll(elements) ?: false + + override fun remove(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanBigArrayBigList).rem(element as Boolean) + BYTE -> (arrayList as ByteBigArrayBigList).rem(element as Byte) + CHAR -> (arrayList as CharBigArrayBigList).rem(element as Char) + SHORT -> (arrayList as ShortBigArrayBigList).rem(element as Short) + INT -> (arrayList as IntBigArrayBigList).rem(element as Int) + LONG -> (arrayList as LongBigArrayBigList).rem(element as Long) + FLOAT -> (arrayList as FloatBigArrayBigList).rem(element as Float) + DOUBLE -> (arrayList as DoubleBigArrayBigList).rem(element as Double) + null -> false + } +} + +internal fun BooleanBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = + BigPrimitiveArrayList(this) + +internal fun ByteBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun CharBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun ShortBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun IntBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun LongBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun FloatBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = BigPrimitiveArrayList(this) + +internal fun DoubleBigArrayBigList.asBigPrimitiveArrayList(): BigPrimitiveArrayList = + BigPrimitiveArrayList(this) + +internal fun BigPrimitiveArrayList.getArrayList(): BooleanBigArrayBigList = + arrayList as BooleanBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): ByteBigArrayBigList = arrayList as ByteBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): CharBigArrayBigList = arrayList as CharBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): ShortBigArrayBigList = arrayList as ShortBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): IntBigArrayBigList = arrayList as IntBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): LongBigArrayBigList = arrayList as LongBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): FloatBigArrayBigList = arrayList as FloatBigArrayBigList + +internal fun BigPrimitiveArrayList.getArrayList(): DoubleBigArrayBigList = + arrayList as DoubleBigArrayBigList diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt new file mode 100644 index 000000000..029ae6ae3 --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolderImpl.kt @@ -0,0 +1,1365 @@ +@file:OptIn(ExperimentalUnsignedTypes::class) + +package org.jetbrains.kotlinx.dataframe.impl.columns + +import it.unimi.dsi.fastutil.booleans.BooleanArrayList +import it.unimi.dsi.fastutil.bytes.ByteArrayList +import it.unimi.dsi.fastutil.chars.CharArrayList +import it.unimi.dsi.fastutil.doubles.DoubleArrayList +import it.unimi.dsi.fastutil.floats.FloatArrayList +import it.unimi.dsi.fastutil.ints.IntAVLTreeSet +import it.unimi.dsi.fastutil.ints.IntArrayList +import it.unimi.dsi.fastutil.ints.IntSortedSet +import it.unimi.dsi.fastutil.longs.LongArrayList +import it.unimi.dsi.fastutil.shorts.ShortArrayList +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder +import org.jetbrains.kotlinx.dataframe.impl.asList +import org.jetbrains.kotlinx.dataframe.impl.isArray +import org.jetbrains.kotlinx.dataframe.impl.isPrimitiveArray +import kotlin.reflect.KType +import kotlin.reflect.full.withNullability +import kotlin.reflect.typeOf + +/** + * Using the [ofPrimitiveArray] functions, this can store natively without converting: + * - [BooleanArray] + * - [ByteArray] + * - [ShortArray] + * - [IntArray] + * - [LongArray] + * - [FloatArray] + * - [DoubleArray] + * - [CharArray] + * - [UByteArray] + * - [UShortArray] + * - [UIntArray] + * - [ULongArray] + * + * Store with converting to primitive arrays: + * - [Array][Array]`<`[Boolean?][Boolean]`>` + * - [Array][Array]`<`[Byte?][Byte]`>` + * - [Array][Array]`<`[Short?][Short]`>` + * - [Array][Array]`<`[Int?][Int]`>` + * - [Array][Array]`<`[Long?][Long]`>` + * - [Array][Array]`<`[Float?][Float]`>` + * - [Array][Array]`<`[Double?][Double]`>` + * - [Array][Array]`<`[Char?][Char]`>` + * - [Collection][Collection]`<`[Boolean?][Boolean]`>` + * - [Collection][Collection]`<`[Byte?][Byte]`>` + * - [Collection][Collection]`<`[Short?][Short]`>` + * - [Collection][Collection]`<`[Int?][Int]`>` + * - [Collection][Collection]`<`[Long?][Long]`>` + * - [Collection][Collection]`<`[Float?][Float]`>` + * - [Collection][Collection]`<`[Double?][Double]`>` + * - [Collection][Collection]`<`[Char?][Char]`>` + * + * Yes, as you can see, also nullable types are supported. The values are stored in primitive arrays, + * and a separate set is used to store the indices of the null values. + * + * Since, [ColumnDataHolder] can be used as a [List], this is invisible to the user. + * + * @param T the type of the elements in the column + * @param list a [PrimitiveArrayList] or any other [MutableList] that can store the elements + * @param zeroValue When [list] is a [PrimitiveArrayList], this is the zero value for the primitive type + * @param nullIndices a set of indices where the null values are stored, only used if [list] is a [PrimitiveArrayList] + */ +internal open class ColumnDataHolderImpl( + protected var list: MutableList = PrimitiveArrayList() as MutableList, + distinct: Lazy>? = null, + protected var zeroValue: Any? = Undefined, + protected val nullIndices: IntSortedSet = IntAVLTreeSet(), +) : ColumnDataHolder { + + protected object Undefined + + protected fun IntSortedSet.fastContains(index: Int): Boolean = + when (size) { + 0 -> false + 1 -> firstInt() == index + 2 -> firstInt() == index || lastInt() == index + else -> contains(index) + } + + override val distinct = distinct ?: lazy { + buildSet { + addAll(this@ColumnDataHolderImpl) + }.toMutableSet() + } + + override val size: Int + get() = if (zeroValue is Undefined) { + nullIndices.size + } else { + list.size + } + + override var usesPrimitiveArrayList = list is PrimitiveArrayList<*> + + override fun canAddPrimitively(element: Any?): Boolean = + when { + !usesPrimitiveArrayList -> false + element == null -> true + list is PrimitiveArrayList<*> -> (list as PrimitiveArrayList<*>).canAdd(element) + else -> false + } + + private inline fun addingElement( + elementIsNull: Boolean, + listCanAddElement: Boolean, + addElementToDistinctSet: () -> Unit, + addElementToList: () -> Unit, + addZeroValueToList: () -> Unit, + setZeroValue: () -> Unit, + ) { + // check if we need to switch to a boxed mutable list to add this element + if (usesPrimitiveArrayList && + !elementIsNull && + !listCanAddElement + ) { + switchToBoxedList() + } + + if (distinct.isInitialized()) { + addElementToDistinctSet() + } + + if (!usesPrimitiveArrayList) { + addElementToList() + } else if (elementIsNull) { + nullIndices += size + if (zeroValue !is Undefined) { + addZeroValueToList() + } + } else { + // set a new zeroValue if the current one is unset + if (zeroValue is Undefined) { + setZeroValue() + nullIndices.forEach { _ -> + addZeroValueToList() + } + } + + addElementToList() + } + } + + internal fun switchToBoxedList() { + list = this.toMutableList() + usesPrimitiveArrayList = false + nullIndices.clear() + } + + override fun add(boolean: Boolean) { + val zeroValue = zeroValueFor(boolean) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(boolean), + addElementToDistinctSet = { (distinct.value as MutableSet) += boolean }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(boolean) + } else { + list.add(boolean as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(byte: Byte) { + val zeroValue = zeroValueFor(byte) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(byte), + addElementToDistinctSet = { (distinct.value as MutableSet) += byte }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(byte) + } else { + list.add(byte as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(short: Short) { + val zeroValue = zeroValueFor(short) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(short), + addElementToDistinctSet = { (distinct.value as MutableSet) += short }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(short) + } else { + list.add(short as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(int: Int) { + val zeroValue = zeroValueFor(int) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(int), + addElementToDistinctSet = { (distinct.value as MutableSet) += int }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(int) + } else { + list.add(int as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(long: Long) { + val zeroValue = zeroValueFor(long) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(long), + addElementToDistinctSet = { (distinct.value as MutableSet) += long }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(long) + } else { + list.add(long as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(float: Float) { + val zeroValue = zeroValueFor(float) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(float), + addElementToDistinctSet = { (distinct.value as MutableSet) += float }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(float) + } else { + list.add(float as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(double: Double) { + val zeroValue = zeroValueFor(double) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(double), + addElementToDistinctSet = { (distinct.value as MutableSet) += double }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(double) + } else { + list.add(double as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(char: Char) { + val zeroValue = zeroValueFor(char) + addingElement( + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(char), + addElementToDistinctSet = { (distinct.value as MutableSet) += char }, + addElementToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(char) + } else { + list.add(char as T) + } + }, + addZeroValueToList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList).add(zeroValue) + } else { + list.add(zeroValue as T) + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun add(element: T) { + addingElement( + elementIsNull = element == null, + listCanAddElement = element != null && (list as? PrimitiveArrayList<*>)?.canAdd(element) ?: true, + addElementToDistinctSet = { (distinct.value as MutableSet) += element }, + addElementToList = { list.add(element) }, + addZeroValueToList = { list.add(zeroValue as T) }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValueFor(element) }, + ) + } + + private inline fun settingElement( + index: Int, + elementIsNull: Boolean, + listCanAddElement: Boolean, + updateDistinctSet: () -> Unit, + setElementInList: () -> Unit, + setZeroValueInList: () -> Unit, + setZeroValue: () -> Unit, + ) { + // check if we need to switch to a boxed mutable list to add this element + if (usesPrimitiveArrayList && + !elementIsNull && + !listCanAddElement + ) { + switchToBoxedList() + } + + if (distinct.isInitialized()) { + updateDistinctSet() + } + + if (!usesPrimitiveArrayList) { + setElementInList() + } else if (elementIsNull) { + nullIndices += index + if (zeroValue is Undefined) { + setZeroValueInList() // might be out of bounds and crash + } + } else { + // set a new zeroValue if the current one is unset + if (zeroValue is Undefined) { + setZeroValue() + nullIndices.forEach { _ -> + setZeroValueInList() + } + } + + setElementInList() + nullIndices -= index + } + } + + override fun set(index: Int, value: Boolean) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Boolean? + } + val countOfPrevValue = (0..)[index] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Byte) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Byte? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Short) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Short? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Int) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Int? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Long) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Long? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Float) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Float? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Double) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Double? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun set(index: Int, value: Char) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = false, + listCanAddElement = !usesPrimitiveArrayList || (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] + } else { + list[index] as Char? + } + val countOfPrevValue = (0..)[it] == prevValue + } else { + list[it] == prevValue + } + } + if (countOfPrevValue <= 1 && value != prevValue) { + (distinct.value as MutableSet).remove(prevValue) + } + }, + setElementInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = value + } else { + list[index] = value as T + } + }, + setZeroValueInList = { + if (usesPrimitiveArrayList) { + (list as PrimitiveArrayList)[index] = zeroValue + } else { + list[index] = zeroValue as T + } + }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun isNull(index: Int): Boolean = + if (usesPrimitiveArrayList) { + nullIndices.fastContains(index) + } else { + list[index] == null + } + + override fun hasNulls(): Boolean = + if (usesPrimitiveArrayList) { + nullIndices.isNotEmpty() + } else { + list.any { it == null } + } + + override fun set(index: Int, value: T) { + val zeroValue = zeroValueFor(value) + settingElement( + index = index, + elementIsNull = value == null, + listCanAddElement = value != null && (list as PrimitiveArrayList<*>).canAdd(value), + updateDistinctSet = { + val prevValue = list[index] + val countOfPrevValue = (0..).remove(prevValue) + } + }, + setElementInList = { list[index] = value }, + setZeroValueInList = { list[index] = zeroValue as T }, + setZeroValue = { this@ColumnDataHolderImpl.zeroValue = zeroValue }, + ) + } + + override fun isEmpty(): Boolean = size == 0 + + override fun indexOf(element: T): Int { + if (!usesPrimitiveArrayList) return list.indexOf(element) + + if (element == null) return nullIndices.firstInt() + for (i in list.indices) { + if (nullIndices.fastContains(i)) continue + if (list[i] == element) return i + } + return -1 + } + + override fun containsAll(elements: Collection): Boolean = elements.toSet().all { contains(it) } + + override fun toSet(): Set = distinct.value + + override fun get(index: Int): T = + when { + usesPrimitiveArrayList && nullIndices.fastContains(index) -> null as T + zeroValue is Undefined && index < nullIndices.size -> null as T + else -> list[index] + } + + override fun get(range: IntRange): List { + if (!usesPrimitiveArrayList) { + return list.subList(range.first, range.last + 1) + } + if (zeroValue is Undefined && range.first >= 0 && range.last < nullIndices.size) { + return List(range.last - range.first + 1) { null as T } + } + + val start = range.first + val sublist = list.subList(start, range.last + 1).toMutableList() + for (i in sublist.indices) { + if (nullIndices.fastContains(start + i)) sublist[i] = null as T + } + return sublist + } + + override fun contains(element: T): Boolean = + if (usesPrimitiveArrayList && element == null) { + nullIndices.isNotEmpty() + } else { + element in list + } + + override fun iterator(): Iterator = listIterator() + + override fun listIterator(): ListIterator = listIterator(0) + + override fun listIterator(index: Int): ListIterator = + when { + !usesPrimitiveArrayList -> list.listIterator(index) + + zeroValue is Undefined -> List(nullIndices.size) { null as T }.listIterator(index) + + else -> object : ListIterator { + + val iterator = list.listIterator(index) + + override fun hasNext(): Boolean = iterator.hasNext() + + override fun hasPrevious(): Boolean = iterator.hasNext() + + override fun next(): T { + val i = nextIndex() + val res = iterator.next() + return if (nullIndices.fastContains(i)) null as T else res + } + + override fun nextIndex(): Int = iterator.nextIndex() + + override fun previous(): T { + val i = previousIndex() + val res = iterator.previous() + return if (nullIndices.fastContains(i)) null as T else res + } + + override fun previousIndex(): Int = iterator.previousIndex() + } + } + + override fun subList(fromIndex: Int, toIndex: Int): List = get(fromIndex..).joinToString(prefix = "[", postfix = "]") +} + +internal val BOOLEAN = typeOf() +internal val BYTE = typeOf() +internal val SHORT = typeOf() +internal val INT = typeOf() +internal val LONG = typeOf() +internal val FLOAT = typeOf() +internal val DOUBLE = typeOf() +internal val CHAR = typeOf() +internal val UBYTE = typeOf() +internal val USHORT = typeOf() +internal val UINT = typeOf() +internal val ULONG = typeOf() +internal val ANY = typeOf() + +internal val NULLABLE_BOOLEAN = typeOf() +internal val NULLABLE_BYTE = typeOf() +internal val NULLABLE_SHORT = typeOf() +internal val NULLABLE_INT = typeOf() +internal val NULLABLE_LONG = typeOf() +internal val NULLABLE_FLOAT = typeOf() +internal val NULLABLE_DOUBLE = typeOf() +internal val NULLABLE_CHAR = typeOf() +internal val NULLABLE_UBYTE = typeOf() +internal val NULLABLE_USHORT = typeOf() +internal val NULLABLE_UINT = typeOf() +internal val NULLABLE_ULONG = typeOf() +internal val NULLABLE_ANY = typeOf() + +internal fun zeroValueOf(type: KType): Any? = + when (type) { + NULLABLE_BOOLEAN, BOOLEAN -> false + NULLABLE_BYTE, BYTE -> 0.toByte() + NULLABLE_SHORT, SHORT -> 0.toShort() + NULLABLE_INT, INT -> 0 + NULLABLE_LONG, LONG -> 0L + NULLABLE_FLOAT, FLOAT -> 0.0f + NULLABLE_DOUBLE, DOUBLE -> 0.0 + NULLABLE_CHAR, CHAR -> 0.toChar() + NULLABLE_UBYTE, UBYTE -> 0.toUByte() + NULLABLE_USHORT, USHORT -> 0.toUShort() + NULLABLE_UINT, UINT -> 0.toUInt() + NULLABLE_ULONG, ULONG -> 0.toULong() + else -> null + } + +internal fun zeroValueFor(element: Any?): Any? = + when (element) { + null -> null + is Boolean -> false + is Byte -> 0.toByte() + is Short -> 0.toShort() + is Int -> 0 + is Long -> 0L + is Float -> 0.0f + is Double -> 0.0 + is Char -> 0.toChar() + is UByte -> 0.toUByte() + is UShort -> 0.toUShort() + is UInt -> 0.toUInt() + is ULong -> 0.toULong() + else -> null + } + +internal fun zeroValueFor(element: Boolean): Boolean = false + +internal fun zeroValueFor(element: Boolean?): Boolean? = if (element == null) null else false + +internal fun zeroValueFor(element: Byte): Byte = 0.toByte() + +internal fun zeroValueFor(element: Byte?): Byte? = if (element == null) null else 0.toByte() + +internal fun zeroValueFor(element: Short): Short = 0.toShort() + +internal fun zeroValueFor(element: Short?): Short? = if (element == null) null else 0.toShort() + +internal fun zeroValueFor(element: Int): Int = 0 + +internal fun zeroValueFor(element: Int?): Int? = if (element == null) null else 0 + +internal fun zeroValueFor(element: Long): Long = 0L + +internal fun zeroValueFor(element: Long?): Long? = if (element == null) null else 0L + +internal fun zeroValueFor(element: Float): Float = 0.0f + +internal fun zeroValueFor(element: Float?): Float? = if (element == null) null else 0.0f + +internal fun zeroValueFor(element: Double): Double = 0.0 + +internal fun zeroValueFor(element: Double?): Double? = if (element == null) null else 0.0 + +internal fun zeroValueFor(element: Char): Char = 0.toChar() + +internal fun zeroValueFor(element: Char?): Char? = if (element == null) null else 0.toChar() + +internal fun zeroValueFor(element: UByte): UByte = 0.toUByte() + +internal fun zeroValueFor(element: UByte?): UByte? = if (element == null) null else 0.toUByte() + +internal fun zeroValueFor(element: UShort): UShort = 0.toUShort() + +internal fun zeroValueFor(element: UShort?): UShort? = if (element == null) null else 0.toUShort() + +internal fun zeroValueFor(element: UInt): UInt = 0.toUInt() + +internal fun zeroValueFor(element: UInt?): UInt? = if (element == null) null else 0.toUInt() + +internal fun zeroValueFor(element: ULong): ULong = 0.toULong() + +internal fun zeroValueFor(element: ULong?): ULong? = if (element == null) null else 0.toULong() + +private fun Array.fillNulls(zeroValue: Any, nullIndices: BooleanArray): Array { + for (i in indices) { + if (this[i] == null) { + this[i] = zeroValue as T + nullIndices[i] = true + } + } + return this as Array +} + +private fun MutableList.fillNulls(zeroValue: Any, nullIndices: BooleanArray): List { + for (i in indices) { + if (this[i] == null) { + this[i] = zeroValue as T + nullIndices[i] = true + } + } + return this as List +} + +private fun BooleanArray.indicesWhereTrue(): IntSortedSet { + val set = IntAVLTreeSet() + for (i in indices) { + if (this[i]) set += i + } + return set +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [collection]. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofCollection( + collection: Collection, + type: KType, + distinct: Lazy>? = null, +): ColumnDataHolder { + if (collection is ColumnDataHolder<*>) return collection as ColumnDataHolder + + try { + val isNull = BooleanArray(collection.size) + val newList = when (type) { + BOOLEAN -> BooleanArrayList((collection as Collection).toBooleanArray()).asPrimitiveArrayList() + + BYTE -> ByteArrayList((collection as Collection).toByteArray()).asPrimitiveArrayList() + + SHORT -> ShortArrayList((collection as Collection).toShortArray()).asPrimitiveArrayList() + + INT -> IntArrayList((collection as Collection).toIntArray()).asPrimitiveArrayList() + + LONG -> LongArrayList((collection as Collection).toLongArray()).asPrimitiveArrayList() + + FLOAT -> FloatArrayList((collection as Collection).toFloatArray()).asPrimitiveArrayList() + + DOUBLE -> DoubleArrayList((collection as Collection).toDoubleArray()).asPrimitiveArrayList() + + CHAR -> CharArrayList((collection as Collection).toCharArray()).asPrimitiveArrayList() + +// UBYTE -> (collection as Collection).toUByteArray().asList() +// +// USHORT -> (collection as Collection).toUShortArray().asList() +// +// UINT -> (collection as Collection).toUIntArray().asList() +// +// ULONG -> (collection as Collection).toULongArray().asList() + + NULLABLE_BOOLEAN -> BooleanArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toBooleanArray(), + ).asPrimitiveArrayList() + + NULLABLE_BYTE -> ByteArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toByteArray(), + ).asPrimitiveArrayList() + + NULLABLE_SHORT -> ShortArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toShortArray(), + ).asPrimitiveArrayList() + + NULLABLE_INT -> IntArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toIntArray(), + ).asPrimitiveArrayList() + + NULLABLE_LONG -> LongArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toLongArray(), + ).asPrimitiveArrayList() + + NULLABLE_FLOAT -> FloatArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toFloatArray(), + ).asPrimitiveArrayList() + + NULLABLE_DOUBLE -> DoubleArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toDoubleArray(), + ).asPrimitiveArrayList() + + NULLABLE_CHAR -> CharArrayList( + (collection as Collection) + .toMutableList() + .fillNulls(zeroValueOf(type)!!, isNull) + .toCharArray(), + ).asPrimitiveArrayList() + +// NULLABLE_UBYTE -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUByteArray() +// .asList() +// +// NULLABLE_USHORT -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUShortArray() +// .asList() +// +// NULLABLE_UINT -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUIntArray() +// .asList() +// +// NULLABLE_ULONG -> (collection as Collection) +// .toMutableList() +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toULongArray() +// .asList() + + else -> { + for ((i, it) in collection.withIndex()) { + if (it == null) isNull[i] = true + } + collection.toMutableList() + } + } as MutableList + + return ColumnDataHolderImpl( + list = newList, + distinct = distinct, + zeroValue = zeroValueOf(type) as T, + nullIndices = if (newList is PrimitiveArrayList<*>) isNull.indicesWhereTrue() else IntAVLTreeSet(), + ) + } catch (e: Exception) { + throw IllegalArgumentException("Can't create ColumnDataHolder from $collection and type $type", e) + } +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [array]. + * If [array] is an array of primitives, it will be converted to a primitive array first before being + * wrapped with [asList]. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofBoxedArray( + array: Array, + type: KType, + distinct: Lazy>? = null, +): ColumnDataHolder { + try { + val isNull = BooleanArray(array.size) + val list = when (type) { + BOOLEAN -> BooleanArrayList((array as Array).toBooleanArray()).asPrimitiveArrayList() + + BYTE -> ByteArrayList((array as Array).toByteArray()).asPrimitiveArrayList() + + SHORT -> ShortArrayList((array as Array).toShortArray()).asPrimitiveArrayList() + + INT -> IntArrayList((array as Array).toIntArray()).asPrimitiveArrayList() + + LONG -> LongArrayList((array as Array).toLongArray()).asPrimitiveArrayList() + + FLOAT -> FloatArrayList((array as Array).toFloatArray()).asPrimitiveArrayList() + + DOUBLE -> DoubleArrayList((array as Array).toDoubleArray()).asPrimitiveArrayList() + + CHAR -> CharArrayList((array as Array).toCharArray()).asPrimitiveArrayList() + +// UBYTE -> (array as Array).toUByteArray().asList() +// +// USHORT -> (array as Array).toUShortArray().asList() +// +// UINT -> (array as Array).toUIntArray().asList() +// +// ULONG -> (array as Array).toULongArray().asList() + + NULLABLE_BOOLEAN -> BooleanArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toBooleanArray(), + ).asPrimitiveArrayList() + + NULLABLE_BYTE -> ByteArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toByteArray(), + ).asPrimitiveArrayList() + + NULLABLE_SHORT -> ShortArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toShortArray(), + ).asPrimitiveArrayList() + + NULLABLE_INT -> IntArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toIntArray(), + ).asPrimitiveArrayList() + + NULLABLE_LONG -> LongArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toLongArray(), + ).asPrimitiveArrayList() + + NULLABLE_FLOAT -> FloatArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toFloatArray(), + ).asPrimitiveArrayList() + + NULLABLE_DOUBLE -> DoubleArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toDoubleArray(), + ).asPrimitiveArrayList() + + NULLABLE_CHAR -> CharArrayList( + (array as Array) + .fillNulls(zeroValueOf(type)!!, isNull) + .toCharArray(), + ).asPrimitiveArrayList() + +// NULLABLE_UBYTE -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUByteArray() +// .asList() +// +// NULLABLE_USHORT -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUShortArray() +// .asList() +// +// NULLABLE_UINT -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toUIntArray() +// .asList() +// +// NULLABLE_ULONG -> (array as Array) +// .fillNulls(zeroValueOf(type)!!, isNull) +// .toULongArray() +// .asList() + + else -> { + for ((i, it) in array.withIndex()) { + if (it == null) isNull[i] = true + } + array.toMutableList() + } + } as MutableList + + return ColumnDataHolderImpl( + list = list, + distinct = distinct, + zeroValue = zeroValueOf(type), + nullIndices = if (list is PrimitiveArrayList<*>) isNull.indicesWhereTrue() else IntAVLTreeSet(), + ) + } catch (e: Exception) { + throw IllegalArgumentException( + "Can't create ColumnDataHolder from $array and mismatching type $type", + e, + ) + } +} + +/** + * Constructs [ColumnDataHolderImpl] using an [asList] wrapper around the [primitiveArray]. + * [primitiveArray] must be an array of primitives, returns `null` if something goes wrong. + */ +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.ofPrimitiveArray( + primitiveArray: Any, + type: KType, + distinct: Lazy>? = null, +): ColumnDataHolder { + val newList = when { + type == BOOLEAN && primitiveArray is BooleanArray -> BooleanArrayList(primitiveArray).asPrimitiveArrayList() + + type == BYTE && primitiveArray is ByteArray -> ByteArrayList(primitiveArray).asPrimitiveArrayList() + + type == SHORT && primitiveArray is ShortArray -> ShortArrayList(primitiveArray).asPrimitiveArrayList() + + type == INT && primitiveArray is IntArray -> IntArrayList(primitiveArray).asPrimitiveArrayList() + + type == LONG && primitiveArray is LongArray -> LongArrayList(primitiveArray).asPrimitiveArrayList() + + type == FLOAT && primitiveArray is FloatArray -> FloatArrayList(primitiveArray).asPrimitiveArrayList() + + type == DOUBLE && primitiveArray is DoubleArray -> DoubleArrayList(primitiveArray).asPrimitiveArrayList() + + type == CHAR && primitiveArray is CharArray -> CharArrayList(primitiveArray).asPrimitiveArrayList() + +// type == UBYTE && primitiveArray is UByteArray -> primitiveArray.asList() +// +// type == USHORT && primitiveArray is UShortArray -> primitiveArray.asList() +// +// type == UINT && primitiveArray is UIntArray -> primitiveArray.asList() +// +// type == ULONG && primitiveArray is ULongArray -> primitiveArray.asList() + + !primitiveArray.isPrimitiveArray -> throw IllegalArgumentException( + "Can't create ColumnDataHolder from non primitive array $primitiveArray and type $type", + ) + + else -> throw IllegalArgumentException( + "Can't create ColumnDataHolder from primitive array $primitiveArray and type $type", + ) + } as MutableList + + return ColumnDataHolderImpl( + list = newList, + distinct = distinct, + zeroValue = zeroValueOf(type), + ) +} + +@Suppress("UNCHECKED_CAST") +internal fun ColumnDataHolder.Companion.of( + any: Any, + type: KType, + distinct: Lazy>? = null, +): ColumnDataHolder = + when { + any is ColumnDataHolder<*> -> any as ColumnDataHolder + + any.isPrimitiveArray -> ofPrimitiveArray( + primitiveArray = any, + type = type, + distinct = distinct, + ) + + any.isArray -> ofBoxedArray( + array = any as Array, + type = type, + distinct = distinct, + ) + + any is Collection<*> -> ofCollection( + collection = any as Collection, + type = type, + distinct = distinct, + ) + + else -> throw IllegalArgumentException("Can't create ColumnDataHolder from $any and type $type") + } + +internal fun ColumnDataHolder.Companion.empty(initCapacity: Int = 0): ColumnDataHolder = + ColumnDataHolderImpl( + list = PrimitiveArrayList(initCapacity) as MutableList, + ) + +internal fun ColumnDataHolder.Companion.emptyForType( + type: KType, + initCapacity: Int = 0, + distinct: Lazy>? = null, +): ColumnDataHolder = + ColumnDataHolderImpl( + list = PrimitiveArrayList.forTypeOrNull( + kType = type.withNullability(false), + initCapacity = initCapacity, + ) as MutableList? ?: mutableListOf(), + distinct = distinct, + zeroValue = zeroValueOf(type), + ) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt index eac43db02..3ba2506df 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.BuildConfig +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.api.dataFrameOf import org.jetbrains.kotlinx.dataframe.impl.isArray @@ -11,10 +12,9 @@ import kotlin.reflect.KType import kotlin.reflect.full.isSubclassOf internal abstract class DataColumnImpl( - protected val values: List, + internal val values: ColumnDataHolder, val name: String, val type: KType, - distinct: Lazy>? = null, ) : DataColumn, DataColumnInternal { @@ -43,11 +43,14 @@ internal abstract class DataColumnImpl( } } - protected val distinct = distinct ?: lazy { values.toSet() } + protected val distinct + get() = values.distinct override fun name() = name - override fun values() = values + override fun values(): List = values.toList() // todo is heavy but tests break without it + + override fun iterator(): Iterator = values.iterator() override fun type() = type @@ -70,7 +73,7 @@ internal abstract class DataColumnImpl( override fun hashCode() = hashCode - override operator fun get(range: IntRange) = createWithValues(values.subList(range.first, range.last + 1)) + override operator fun get(range: IntRange) = createWithValues(values[range]) protected abstract fun createWithValues(values: List, hasNulls: Boolean? = null): DataColumn } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt index d07c0b9d0..130f934a9 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/FrameColumnImpl.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.schema @@ -11,22 +12,21 @@ import org.jetbrains.kotlinx.dataframe.impl.createStarProjectedType import org.jetbrains.kotlinx.dataframe.impl.schema.intersectSchemas import org.jetbrains.kotlinx.dataframe.nrow import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema +import org.jetbrains.kotlinx.dataframe.toColumnDataHolder import kotlin.reflect.KType -internal open class FrameColumnImpl constructor( +internal open class FrameColumnImpl( name: String, - values: List>, + values: ColumnDataHolder>, columnSchema: Lazy? = null, - distinct: Lazy>>? = null, ) : DataColumnImpl>( values = values, name = name, type = DataFrame::class.createStarProjectedType(false), - distinct = distinct, ), FrameColumn { - override fun rename(newName: String) = FrameColumnImpl(newName, values, schema, distinct) + override fun rename(newName: String) = FrameColumnImpl(newName, values, schema) override fun defaultValue() = null @@ -37,7 +37,11 @@ internal open class FrameColumnImpl constructor( override fun changeType(type: KType) = throw UnsupportedOperationException() - override fun distinct() = FrameColumnImpl(name, distinct.value.toList(), schema, distinct) + override fun distinct() = FrameColumnImpl( + name = name, + values = toSet().toColumnDataHolder(type, distinct), + columnSchema = schema + ) override val schema: Lazy = columnSchema ?: lazy { values.mapNotNull { it.takeIf { it.nrow > 0 }?.schema() }.intersectSchemas() diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt new file mode 100644 index 000000000..b0503b75a --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt @@ -0,0 +1,1359 @@ +package org.jetbrains.kotlinx.dataframe.impl.columns + +import it.unimi.dsi.fastutil.booleans.BooleanArrayList +import it.unimi.dsi.fastutil.booleans.BooleanListIterator +import it.unimi.dsi.fastutil.bytes.ByteArrayList +import it.unimi.dsi.fastutil.bytes.ByteListIterator +import it.unimi.dsi.fastutil.chars.CharArrayList +import it.unimi.dsi.fastutil.chars.CharListIterator +import it.unimi.dsi.fastutil.doubles.DoubleArrayList +import it.unimi.dsi.fastutil.doubles.DoubleListIterator +import it.unimi.dsi.fastutil.floats.FloatArrayList +import it.unimi.dsi.fastutil.floats.FloatListIterator +import it.unimi.dsi.fastutil.ints.IntArrayList +import it.unimi.dsi.fastutil.ints.IntListIterator +import it.unimi.dsi.fastutil.longs.LongArrayList +import it.unimi.dsi.fastutil.longs.LongListIterator +import it.unimi.dsi.fastutil.shorts.ShortArrayList +import it.unimi.dsi.fastutil.shorts.ShortListIterator +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.BOOLEAN +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.BYTE +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.CHAR +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.DOUBLE +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.FLOAT +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.INT +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.LONG +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList.State.SHORT +import kotlin.reflect.KType +import kotlin.reflect.typeOf +import org.jetbrains.kotlinx.dataframe.impl.columns.BOOLEAN as BOOLEAN_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.BYTE as BYTE_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.CHAR as CHAR_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.DOUBLE as DOUBLE_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.FLOAT as FLOAT_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.INT as INT_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.LONG as LONG_TYPE +import org.jetbrains.kotlinx.dataframe.impl.columns.SHORT as SHORT_TYPE + +/** + * Universal wrapper around [BooleanArrayList], [ByteArrayList], [CharArrayList], + * [ShortArrayList], [IntArrayList], [LongArrayList], [FloatArrayList], and [DoubleArrayList]. + * + * While boxing can occur when working with the elements, the list itself is unboxed. + */ +internal class PrimitiveArrayList private constructor(arrayList: List?, state: State?) : + MutableList { + + companion object { + fun forTypeOrNull(kType: KType, initCapacity: Int = 0): PrimitiveArrayList? { + return when (kType) { + BOOLEAN_TYPE -> PrimitiveArrayList(BOOLEAN, initCapacity) + BYTE_TYPE -> PrimitiveArrayList(BYTE, initCapacity) + CHAR_TYPE -> PrimitiveArrayList(CHAR, initCapacity) + SHORT_TYPE -> PrimitiveArrayList(SHORT, initCapacity) + INT_TYPE -> PrimitiveArrayList(INT, initCapacity) + LONG_TYPE -> PrimitiveArrayList(LONG, initCapacity) + FLOAT_TYPE -> PrimitiveArrayList(FLOAT, initCapacity) + DOUBLE_TYPE -> PrimitiveArrayList(DOUBLE, initCapacity) + else -> return null + } as PrimitiveArrayList + } + + inline fun forTypeOrNull(initCapacity: Int = 0): PrimitiveArrayList? = + forTypeOrNull(typeOf(), initCapacity) + + fun forType(kType: KType, initCapacity: Int = 0): PrimitiveArrayList = + forTypeOrNull(kType, initCapacity) ?: throw IllegalArgumentException("Unsupported type: $kType") + + inline fun forType(initCapacity: Int = 0): PrimitiveArrayList = + forType(typeOf(), initCapacity) + + operator fun invoke(booleans: BooleanArrayList): PrimitiveArrayList = + PrimitiveArrayList(booleans, BOOLEAN) + + operator fun invoke(bytes: ByteArrayList): PrimitiveArrayList = PrimitiveArrayList(bytes, BYTE) + + operator fun invoke(chars: CharArrayList): PrimitiveArrayList = PrimitiveArrayList(chars, CHAR) + + operator fun invoke(shorts: ShortArrayList): PrimitiveArrayList = PrimitiveArrayList(shorts, SHORT) + + operator fun invoke(ints: IntArrayList): PrimitiveArrayList = PrimitiveArrayList(ints, INT) + + operator fun invoke(longs: LongArrayList): PrimitiveArrayList = PrimitiveArrayList(longs, LONG) + + operator fun invoke(floats: FloatArrayList): PrimitiveArrayList = PrimitiveArrayList(floats, FLOAT) + + operator fun invoke(doubles: DoubleArrayList): PrimitiveArrayList = + PrimitiveArrayList(doubles, DOUBLE) + + operator fun invoke(booleans: BooleanArray): PrimitiveArrayList = + PrimitiveArrayList(BooleanArrayList(booleans), BOOLEAN) + + operator fun invoke(bytes: ByteArray): PrimitiveArrayList = + PrimitiveArrayList(ByteArrayList(bytes), BYTE) + + operator fun invoke(chars: CharArray): PrimitiveArrayList = + PrimitiveArrayList(CharArrayList(chars), CHAR) + + operator fun invoke(shorts: ShortArray): PrimitiveArrayList = + PrimitiveArrayList(ShortArrayList(shorts), SHORT) + + operator fun invoke(ints: IntArray): PrimitiveArrayList = PrimitiveArrayList(IntArrayList(ints), INT) + + operator fun invoke(longs: LongArray): PrimitiveArrayList = + PrimitiveArrayList(LongArrayList(longs), LONG) + + operator fun invoke(floats: FloatArray): PrimitiveArrayList = + PrimitiveArrayList(FloatArrayList(floats), FLOAT) + + operator fun invoke(doubles: DoubleArray): PrimitiveArrayList = + PrimitiveArrayList(DoubleArrayList(doubles), DOUBLE) + + inline operator fun invoke(initCapacity: Int = 0): PrimitiveArrayList = + forTypeOrNull(initCapacity) ?: PrimitiveArrayList(null, null).also { it.initCapacity = initCapacity } + } + + var initCapacity = arrayList?.size ?: 0 + + constructor(state: State?) : this( + arrayList = when (state) { + BOOLEAN -> BooleanArrayList() + BYTE -> ByteArrayList() + CHAR -> CharArrayList() + SHORT -> ShortArrayList() + INT -> IntArrayList() + LONG -> LongArrayList() + FLOAT -> FloatArrayList() + DOUBLE -> DoubleArrayList() + null -> null + } as List?, + state = state, + ) + + constructor(state: State?, initCapacity: Int) : this( + arrayList = when (state) { + BOOLEAN -> BooleanArrayList(initCapacity) + BYTE -> ByteArrayList(initCapacity) + CHAR -> CharArrayList(initCapacity) + SHORT -> ShortArrayList(initCapacity) + INT -> IntArrayList(initCapacity) + LONG -> LongArrayList(initCapacity) + FLOAT -> FloatArrayList(initCapacity) + DOUBLE -> DoubleArrayList(initCapacity) + null -> null + } as List?, + state = state, + ) + + enum class State { + BOOLEAN, + BYTE, + CHAR, + SHORT, + INT, + LONG, + FLOAT, + DOUBLE, + } + + internal var arrayList: List? = arrayList + private set + + internal var state = state + private set + + internal fun initializeArrayList(state: State) { + try { + arrayList = when (state) { + BOOLEAN -> BooleanArrayList(initCapacity) + BYTE -> ByteArrayList(initCapacity) + CHAR -> CharArrayList(initCapacity) + SHORT -> ShortArrayList(initCapacity) + INT -> IntArrayList(initCapacity) + LONG -> LongArrayList(initCapacity) + FLOAT -> FloatArrayList(initCapacity) + DOUBLE -> DoubleArrayList(initCapacity) + } as List + } catch (e: Error) { + throw IllegalStateException("Failed to initialize $state ArrayList of capacity $initCapacity", e) + } + this.state = state + } + + override fun listIterator(): MutableListIterator = listIterator(0) + + override fun listIterator(index: Int): MutableListIterator = + object : MutableListIterator { + private var it = arrayList?.listIterator(index) + + override fun add(element: T) { + when (state) { + BOOLEAN -> (it as BooleanListIterator).add(element as Boolean) + + BYTE -> (it as ByteListIterator).add(element as Byte) + + CHAR -> (it as CharListIterator).add(element as Char) + + SHORT -> (it as ShortListIterator).add(element as Short) + + INT -> (it as IntListIterator).add(element as Int) + + LONG -> (it as LongListIterator).add(element as Long) + + FLOAT -> (it as FloatListIterator).add(element as Float) + + DOUBLE -> (it as DoubleListIterator).add(element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + it = arrayList!!.listIterator(index) + add(element) + } + } + } + + override fun hasNext(): Boolean = it?.hasNext() ?: false + + override fun hasPrevious(): Boolean = it?.hasPrevious() ?: false + + override fun next(): T = it?.next() ?: error("No next element") + + override fun nextIndex(): Int = it?.nextIndex() ?: -1 + + override fun previous(): T = it?.previous() ?: error("No previous element") + + override fun previousIndex(): Int = it?.previousIndex() ?: -1 + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "KotlinConstantConditions") + override fun remove() { + when (val it = it) { + is MutableListIterator<*> -> it.remove() + is java.util.Iterator<*> -> it.remove() + null -> error("No element to remove") + else -> throw UnsupportedOperationException() + } + } + + override fun set(element: T) { + when (state) { + BOOLEAN -> (it as BooleanListIterator).set(element as Boolean) + + BYTE -> (it as ByteListIterator).set(element as Byte) + + CHAR -> (it as CharListIterator).set(element as Char) + + SHORT -> (it as ShortListIterator).set(element as Short) + + INT -> (it as IntListIterator).set(element as Int) + + LONG -> (it as LongListIterator).set(element as Long) + + FLOAT -> (it as FloatListIterator).set(element as Float) + + DOUBLE -> (it as DoubleListIterator).set(element as Double) + + null -> { + when (element) { + is Boolean -> initializeArrayList(BOOLEAN) + is Byte -> initializeArrayList(BYTE) + is Char -> initializeArrayList(CHAR) + is Short -> initializeArrayList(SHORT) + is Int -> initializeArrayList(INT) + is Long -> initializeArrayList(LONG) + is Float -> initializeArrayList(FLOAT) + is Double -> initializeArrayList(DOUBLE) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + it = arrayList!!.listIterator(index) + set(element) + } + } + } + } + + override fun iterator(): MutableIterator = listIterator() + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun lastIndexOf(element: T): Int = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).lastIndexOf(element as Boolean) + BYTE -> (arrayList as ByteArrayList).lastIndexOf(element as Byte) + CHAR -> (arrayList as CharArrayList).lastIndexOf(element as Char) + SHORT -> (arrayList as ShortArrayList).lastIndexOf(element as Short) + INT -> (arrayList as IntArrayList).lastIndexOf(element as Int) + LONG -> (arrayList as LongArrayList).lastIndexOf(element as Long) + FLOAT -> (arrayList as FloatArrayList).lastIndexOf(element as Float) + DOUBLE -> (arrayList as DoubleArrayList).lastIndexOf(element as Double) + null -> error("List is not initialized") + } + + fun lastIndexOf(element: Boolean) = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Byte) = + when (state) { + BYTE -> (arrayList as ByteArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Char) = + when (state) { + CHAR -> (arrayList as CharArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Short) = + when (state) { + SHORT -> (arrayList as ShortArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Int) = + when (state) { + INT -> (arrayList as IntArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Long) = + when (state) { + LONG -> (arrayList as LongArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Float) = + when (state) { + FLOAT -> (arrayList as FloatArrayList).lastIndexOf(element) + else -> -1 + } + + fun lastIndexOf(element: Double) = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).lastIndexOf(element) + else -> -1 + } + + fun addBoxed(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).add(element as Boolean) + + BYTE -> (arrayList as ByteArrayList).add(element as Byte) + + CHAR -> (arrayList as CharArrayList).add(element as Char) + + SHORT -> (arrayList as ShortArrayList).add(element as Short) + + INT -> (arrayList as IntArrayList).add(element as Int) + + LONG -> (arrayList as LongArrayList).add(element as Long) + + FLOAT -> (arrayList as FloatArrayList).add(element as Float) + + DOUBLE -> (arrayList as DoubleArrayList).add(element as Double) + + null -> { + when (element) { + is Boolean -> (this as PrimitiveArrayList).add(element) + is Byte -> (this as PrimitiveArrayList).add(element) + is Char -> (this as PrimitiveArrayList).add(element) + is Short -> (this as PrimitiveArrayList).add(element) + is Int -> (this as PrimitiveArrayList).add(element) + is Long -> (this as PrimitiveArrayList).add(element) + is Float -> (this as PrimitiveArrayList).add(element) + is Double -> (this as PrimitiveArrayList).add(element) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + } + } + + /** Prefer the primitive overloads! */ + @Suppress("UNCHECKED_CAST") + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun add(element: T): Boolean = addBoxed(element) + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun add(index: Int, element: T) { + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).add(index, element as Boolean) + + BYTE -> (arrayList as ByteArrayList).add(index, element as Byte) + + CHAR -> (arrayList as CharArrayList).add(index, element as Char) + + SHORT -> (arrayList as ShortArrayList).add(index, element as Short) + + INT -> (arrayList as IntArrayList).add(index, element as Int) + + LONG -> (arrayList as LongArrayList).add(index, element as Long) + + FLOAT -> (arrayList as FloatArrayList).add(index, element as Float) + + DOUBLE -> (arrayList as DoubleArrayList).add(index, element as Double) + + null -> { + when (element) { + is Boolean -> (this as PrimitiveArrayList).add(index, element) + is Byte -> (this as PrimitiveArrayList).add(index, element) + is Char -> (this as PrimitiveArrayList).add(index, element) + is Short -> (this as PrimitiveArrayList).add(index, element) + is Int -> (this as PrimitiveArrayList).add(index, element) + is Long -> (this as PrimitiveArrayList).add(index, element) + is Float -> (this as PrimitiveArrayList).add(index, element) + is Double -> (this as PrimitiveArrayList).add(index, element) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + } + } + } + + @Suppress("UNCHECKED_CAST") + override fun addAll(index: Int, elements: Collection): Boolean = + if (elements.isEmpty()) { + false + } else { + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).addAll(index, elements as Collection) + + BYTE -> (arrayList as ByteArrayList).addAll(index, elements as Collection) + + CHAR -> (arrayList as CharArrayList).addAll(index, elements as Collection) + + SHORT -> (arrayList as ShortArrayList).addAll(index, elements as Collection) + + INT -> (arrayList as IntArrayList).addAll(index, elements as Collection) + + LONG -> (arrayList as LongArrayList).addAll(index, elements as Collection) + + FLOAT -> (arrayList as FloatArrayList).addAll(index, elements as Collection) + + DOUBLE -> (arrayList as DoubleArrayList).addAll(index, elements as Collection) + + null -> { + when (elements.first()) { + is Boolean -> initializeArrayList(BOOLEAN) + + is Byte -> initializeArrayList(BYTE) + + is Char -> initializeArrayList(CHAR) + + is Short -> initializeArrayList(SHORT) + + is Int -> initializeArrayList(INT) + + is Long -> initializeArrayList(LONG) + + is Float -> initializeArrayList(FLOAT) + + is Double -> initializeArrayList(DOUBLE) + + else -> throw IllegalArgumentException( + "Unsupported element type: ${elements.first()::class}", + ) + } + addAll(index, elements) + } + } + } + + @Suppress("UNCHECKED_CAST") + override fun addAll(elements: Collection): Boolean = + if (elements.isEmpty()) { + false + } else { + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).addAll(elements as Collection) + + BYTE -> (arrayList as ByteArrayList).addAll(elements as Collection) + + CHAR -> (arrayList as CharArrayList).addAll(elements as Collection) + + SHORT -> (arrayList as ShortArrayList).addAll(elements as Collection) + + INT -> (arrayList as IntArrayList).addAll(elements as Collection) + + LONG -> (arrayList as LongArrayList).addAll(elements as Collection) + + FLOAT -> (arrayList as FloatArrayList).addAll(elements as Collection) + + DOUBLE -> (arrayList as DoubleArrayList).addAll(elements as Collection) + + null -> { + when (elements.first()) { + is Boolean -> initializeArrayList(BOOLEAN) + + is Byte -> initializeArrayList(BYTE) + + is Char -> initializeArrayList(CHAR) + + is Short -> initializeArrayList(SHORT) + + is Int -> initializeArrayList(INT) + + is Long -> initializeArrayList(LONG) + + is Float -> initializeArrayList(FLOAT) + + is Double -> initializeArrayList(DOUBLE) + + else -> throw IllegalArgumentException( + "Unsupported element type: ${elements.first()::class}", + ) + } + addAll(elements) + true + } + } + } + + /** Prefer the primitive overloads! */ + fun canAdd(element: Any): Boolean = + when (state) { + BOOLEAN -> element is Boolean + + BYTE -> element is Byte + + CHAR -> element is Char + + SHORT -> element is Short + + INT -> element is Int + + LONG -> element is Long + + FLOAT -> element is Float + + DOUBLE -> element is Double + + null -> + element is Boolean || + element is Byte || + element is Char || + element is Short || + element is Int || + element is Long || + element is Float || + element is Double + } + + fun canAdd(element: Boolean) = state == BOOLEAN || state == null + + fun canAdd(element: Byte) = state == BYTE || state == null + + fun canAdd(element: Char) = state == CHAR || state == null + + fun canAdd(element: Short) = state == SHORT || state == null + + fun canAdd(element: Int) = state == INT || state == null + + fun canAdd(element: Long) = state == LONG || state == null + + fun canAdd(element: Float) = state == FLOAT || state == null + + fun canAdd(element: Double) = state == DOUBLE || state == null + + override val size: Int + get() = arrayList?.size ?: 0 + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun clear() = (arrayList as java.util.Collection<*>).clear() + + /** Prefer the primitive overloads! */ + @Suppress("UNCHECKED_CAST") + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun get(index: Int): T = getBoxed(index) + + fun getBoxed(index: Int): T = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).getBoolean(index) + BYTE -> (arrayList as ByteArrayList).getByte(index) + CHAR -> (arrayList as CharArrayList).getChar(index) + SHORT -> (arrayList as ShortArrayList).getShort(index) + INT -> (arrayList as IntArrayList).getInt(index) + LONG -> (arrayList as LongArrayList).getLong(index) + FLOAT -> (arrayList as FloatArrayList).getFloat(index) + DOUBLE -> (arrayList as DoubleArrayList).getDouble(index) + else -> throw IllegalStateException("Index: $index, Size: $size") + } as T + + override fun isEmpty(): Boolean = arrayList?.isEmpty() ?: true + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun indexOf(element: T): Int = indexOfBoxed(element) + + fun indexOfBoxed(element: T): Int = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).indexOf(element as Boolean) + BYTE -> (arrayList as ByteArrayList).indexOf(element as Byte) + CHAR -> (arrayList as CharArrayList).indexOf(element as Char) + SHORT -> (arrayList as ShortArrayList).indexOf(element as Short) + INT -> (arrayList as IntArrayList).indexOf(element as Int) + LONG -> (arrayList as LongArrayList).indexOf(element as Long) + FLOAT -> (arrayList as FloatArrayList).indexOf(element as Float) + DOUBLE -> (arrayList as DoubleArrayList).indexOf(element as Double) + null -> -1 + } + + @Suppress("UNCHECKED_CAST") + override fun containsAll(elements: Collection): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).containsAll(elements as Collection) + BYTE -> (arrayList as ByteArrayList).containsAll(elements as Collection) + CHAR -> (arrayList as CharArrayList).containsAll(elements as Collection) + SHORT -> (arrayList as ShortArrayList).containsAll(elements as Collection) + INT -> (arrayList as IntArrayList).containsAll(elements as Collection) + LONG -> (arrayList as LongArrayList).containsAll(elements as Collection) + FLOAT -> (arrayList as FloatArrayList).containsAll(elements as Collection) + DOUBLE -> (arrayList as DoubleArrayList).containsAll(elements as Collection) + null -> elements.isEmpty() + } + + fun containsBoxed(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).contains(element as Boolean) + BYTE -> (arrayList as ByteArrayList).contains(element as Byte) + CHAR -> (arrayList as CharArrayList).contains(element as Char) + SHORT -> (arrayList as ShortArrayList).contains(element as Short) + INT -> (arrayList as IntArrayList).contains(element as Int) + LONG -> (arrayList as LongArrayList).contains(element as Long) + FLOAT -> (arrayList as FloatArrayList).contains(element as Float) + DOUBLE -> (arrayList as DoubleArrayList).contains(element as Double) + null -> false + } + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun contains(element: T): Boolean = containsBoxed(element) + + fun removeAtBoxed(index: Int): T = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).removeBoolean(index) + BYTE -> (arrayList as ByteArrayList).removeByte(index) + CHAR -> (arrayList as CharArrayList).removeChar(index) + SHORT -> (arrayList as ShortArrayList).removeShort(index) + INT -> (arrayList as IntArrayList).removeInt(index) + LONG -> (arrayList as LongArrayList).removeLong(index) + FLOAT -> (arrayList as FloatArrayList).removeFloat(index) + DOUBLE -> (arrayList as DoubleArrayList).removeDouble(index) + else -> throw IllegalStateException("Index: $index, Size: $size") + } as T + + /** Prefer the primitive overloads! */ + @Suppress("UNCHECKED_CAST") + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun removeAt(index: Int): T = removeAtBoxed(index) + + @Suppress("UNCHECKED_CAST") + override fun subList(fromIndex: Int, toIndex: Int): PrimitiveArrayList = + when (state) { + BOOLEAN -> BooleanArrayList( + (arrayList as BooleanArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + BYTE -> ByteArrayList( + (arrayList as ByteArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + CHAR -> CharArrayList( + (arrayList as CharArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + SHORT -> ShortArrayList( + (arrayList as ShortArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + INT -> IntArrayList( + (arrayList as IntArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + LONG -> LongArrayList( + (arrayList as LongArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + FLOAT -> FloatArrayList( + (arrayList as FloatArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + DOUBLE -> DoubleArrayList( + (arrayList as DoubleArrayList).subList(fromIndex, toIndex), + ).asPrimitiveArrayList() + + null -> error("List is not initialized") + } as PrimitiveArrayList + + fun setBoxed(index: Int, element: T): T = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).set(index, element as Boolean) + + BYTE -> (arrayList as ByteArrayList).set(index, element as Byte) + + CHAR -> (arrayList as CharArrayList).set(index, element as Char) + + SHORT -> (arrayList as ShortArrayList).set(index, element as Short) + + INT -> (arrayList as IntArrayList).set(index, element as Int) + + LONG -> (arrayList as LongArrayList).set(index, element as Long) + + FLOAT -> (arrayList as FloatArrayList).set(index, element as Float) + + DOUBLE -> (arrayList as DoubleArrayList).set(index, element as Double) + + null -> { + when (element) { + is Boolean -> (this as PrimitiveArrayList).set(index, element) + is Byte -> (this as PrimitiveArrayList).set(index, element) + is Char -> (this as PrimitiveArrayList).set(index, element) + is Short -> (this as PrimitiveArrayList).set(index, element) + is Int -> (this as PrimitiveArrayList).set(index, element) + is Long -> (this as PrimitiveArrayList).set(index, element) + is Float -> (this as PrimitiveArrayList).set(index, element) + is Double -> (this as PrimitiveArrayList).set(index, element) + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + } + } as T + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + @Suppress("UNCHECKED_CAST") + override fun set(index: Int, element: T): T = setBoxed(index, element) + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun retainAll(elements: Collection): Boolean = + (arrayList as java.util.Collection<*>?)?.retainAll(elements) ?: false + + @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + override fun removeAll(elements: Collection): Boolean = + (arrayList as java.util.Collection<*>?)?.removeAll(elements) ?: false + + fun removeBoxed(element: T): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).rem(element as Boolean) + BYTE -> (arrayList as ByteArrayList).rem(element as Byte) + CHAR -> (arrayList as CharArrayList).rem(element as Char) + SHORT -> (arrayList as ShortArrayList).rem(element as Short) + INT -> (arrayList as IntArrayList).rem(element as Int) + LONG -> (arrayList as LongArrayList).rem(element as Long) + FLOAT -> (arrayList as FloatArrayList).rem(element as Float) + DOUBLE -> (arrayList as DoubleArrayList).rem(element as Double) + null -> false + } + + /** Prefer the primitive overloads! */ + @Deprecated("", level = DeprecationLevel.HIDDEN) + override fun remove(element: T): Boolean = removeBoxed(element) + } + +internal fun BooleanArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun ByteArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun CharArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun ShortArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun IntArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun LongArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun FloatArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun DoubleArrayList.asPrimitiveArrayList(): PrimitiveArrayList = PrimitiveArrayList(this) + +internal fun PrimitiveArrayList.getArrayList(): BooleanArrayList = arrayList as BooleanArrayList + +internal fun PrimitiveArrayList.getArrayList(): ByteArrayList = arrayList as ByteArrayList + +internal fun PrimitiveArrayList.getArrayList(): CharArrayList = arrayList as CharArrayList + +internal fun PrimitiveArrayList.getArrayList(): ShortArrayList = arrayList as ShortArrayList + +internal fun PrimitiveArrayList.getArrayList(): IntArrayList = arrayList as IntArrayList + +internal fun PrimitiveArrayList.getArrayList(): LongArrayList = arrayList as LongArrayList + +internal fun PrimitiveArrayList.getArrayList(): FloatArrayList = arrayList as FloatArrayList + +internal fun PrimitiveArrayList.getArrayList(): DoubleArrayList = arrayList as DoubleArrayList + +// region get + +internal operator fun PrimitiveArrayList.get(index: Int): Boolean = + (arrayList as BooleanArrayList).getBoolean(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Byte = (arrayList as ByteArrayList).getByte(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Char = (arrayList as CharArrayList).getChar(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Short = (arrayList as ShortArrayList).getShort(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Int = (arrayList as IntArrayList).getInt(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Long = (arrayList as LongArrayList).getLong(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Float = (arrayList as FloatArrayList).getFloat(index) + +internal operator fun PrimitiveArrayList.get(index: Int): Double = + (arrayList as DoubleArrayList).getDouble(index) + +// endregion +// region add + +internal fun PrimitiveArrayList.add(element: Boolean): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).add(element) + + null -> { + initializeArrayList(BOOLEAN) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Byte): Boolean = + when (state) { + BYTE -> (arrayList as ByteArrayList).add(element) + + null -> { + initializeArrayList(BYTE) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Char): Boolean = + when (state) { + CHAR -> (arrayList as CharArrayList).add(element) + + null -> { + initializeArrayList(CHAR) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Short): Boolean = + when (state) { + SHORT -> (arrayList as ShortArrayList).add(element) + + null -> { + initializeArrayList(SHORT) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Int): Boolean = + when (state) { + INT -> (arrayList as IntArrayList).add(element) + + null -> { + initializeArrayList(INT) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Long): Boolean = + when (state) { + LONG -> (arrayList as LongArrayList).add(element) + + null -> { + initializeArrayList(LONG) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Float): Boolean = + when (state) { + FLOAT -> (arrayList as FloatArrayList).add(element) + + null -> { + initializeArrayList(FLOAT) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal fun PrimitiveArrayList.add(element: Double): Boolean = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).add(element) + + null -> { + initializeArrayList(DOUBLE) + add(element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } + +internal operator fun PrimitiveArrayList.plusAssign(element: Boolean) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Byte) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Char) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Short) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Int) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Long) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Float) { + add(element) +} + +internal operator fun PrimitiveArrayList.plusAssign(element: Double) { + add(element) +} + +internal fun PrimitiveArrayList.add(index: Int, element: Boolean) { + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).add(index, element) + + null -> { + initializeArrayList(BOOLEAN) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Byte) { + when (state) { + BYTE -> (arrayList as ByteArrayList).add(index, element) + + null -> { + initializeArrayList(BYTE) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Char) { + when (state) { + CHAR -> (arrayList as CharArrayList).add(index, element) + + null -> { + initializeArrayList(CHAR) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Short) { + when (state) { + SHORT -> (arrayList as ShortArrayList).add(index, element) + + null -> { + initializeArrayList(SHORT) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Int) { + when (state) { + INT -> (arrayList as IntArrayList).add(index, element) + + null -> { + initializeArrayList(INT) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Long) { + when (state) { + LONG -> (arrayList as LongArrayList).add(index, element) + + null -> { + initializeArrayList(LONG) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Float) { + when (state) { + FLOAT -> (arrayList as FloatArrayList).add(index, element) + + null -> { + initializeArrayList(FLOAT) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +internal fun PrimitiveArrayList.add(index: Int, element: Double) { + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).add(index, element) + + null -> { + initializeArrayList(DOUBLE) + add(index, element) + } + + else -> throw IllegalArgumentException("Unsupported element type: ${element::class}") + } +} + +// endregion +// region indexOf + +internal fun PrimitiveArrayList.indexOf(element: Boolean): Int = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Byte): Int = + when (state) { + BYTE -> (arrayList as ByteArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Char): Int = + when (state) { + CHAR -> (arrayList as CharArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Short): Int = + when (state) { + SHORT -> (arrayList as ShortArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Int): Int = + when (state) { + INT -> (arrayList as IntArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Long): Int = + when (state) { + LONG -> (arrayList as LongArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Float): Int = + when (state) { + FLOAT -> (arrayList as FloatArrayList).indexOf(element) + else -> -1 + } + +internal fun PrimitiveArrayList.indexOf(element: Double): Int = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).indexOf(element) + else -> -1 + } + +// endregion +// region contains + +internal fun PrimitiveArrayList.contains(element: Boolean): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Byte): Boolean = + when (state) { + BYTE -> (arrayList as ByteArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Char): Boolean = + when (state) { + CHAR -> (arrayList as CharArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Short): Boolean = + when (state) { + SHORT -> (arrayList as ShortArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Int): Boolean = + when (state) { + INT -> (arrayList as IntArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Long): Boolean = + when (state) { + LONG -> (arrayList as LongArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Float): Boolean = + when (state) { + FLOAT -> (arrayList as FloatArrayList).contains(element) + else -> false + } + +internal fun PrimitiveArrayList.contains(element: Double): Boolean = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).contains(element) + else -> false + } + +// endregion +// region removeAt + +internal fun PrimitiveArrayList.removeAt(index: Int): Boolean = + (arrayList as BooleanArrayList).removeBoolean(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Byte = (arrayList as ByteArrayList).removeByte(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Char = (arrayList as CharArrayList).removeChar(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Short = (arrayList as ShortArrayList).removeShort(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Int = (arrayList as IntArrayList).removeInt(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Long = (arrayList as LongArrayList).removeLong(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Float = (arrayList as FloatArrayList).removeFloat(index) + +internal fun PrimitiveArrayList.removeAt(index: Int): Double = + (arrayList as DoubleArrayList).removeDouble(index) + +// endregion +// region set + +internal operator fun PrimitiveArrayList.set(index: Int, element: Boolean): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).set(index, element) + + null -> { + initializeArrayList(BOOLEAN) + set(index, element) + } + + else -> false + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Byte): Byte = + when (state) { + BYTE -> (arrayList as ByteArrayList).set(index, element) + + null -> { + initializeArrayList(BYTE) + set(index, element) + } + + else -> 0 + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Char): Char = + when (state) { + CHAR -> (arrayList as CharArrayList).set(index, element) + + null -> { + initializeArrayList(CHAR) + set(index, element) + } + + else -> 0.toChar() + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Short): Short = + when (state) { + SHORT -> (arrayList as ShortArrayList).set(index, element) + + null -> { + initializeArrayList(SHORT) + set(index, element) + } + + else -> 0 + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Int): Int = + when (state) { + INT -> (arrayList as IntArrayList).set(index, element) + + null -> { + initializeArrayList(INT) + set(index, element) + } + + else -> 0 + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Long): Long = + when (state) { + LONG -> (arrayList as LongArrayList).set(index, element) + + null -> { + initializeArrayList(LONG) + set(index, element) + } + + else -> 0 + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Float): Float = + when (state) { + FLOAT -> (arrayList as FloatArrayList).set(index, element) + + null -> { + initializeArrayList(FLOAT) + set(index, element) + } + + else -> 0f + } + +internal operator fun PrimitiveArrayList.set(index: Int, element: Double): Double = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).set(index, element) + + null -> { + initializeArrayList(DOUBLE) + set(index, element) + } + + else -> 0.0 + } + +// endregion +// region remove + +internal fun PrimitiveArrayList.remove(element: Boolean): Boolean = + when (state) { + BOOLEAN -> (arrayList as BooleanArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Byte): Boolean = + when (state) { + BYTE -> (arrayList as ByteArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Char): Boolean = + when (state) { + CHAR -> (arrayList as CharArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Short): Boolean = + when (state) { + SHORT -> (arrayList as ShortArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Int): Boolean = + when (state) { + INT -> (arrayList as IntArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Long): Boolean = + when (state) { + LONG -> (arrayList as LongArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Float): Boolean = + when (state) { + FLOAT -> (arrayList as FloatArrayList).rem(element) + else -> false + } + +internal fun PrimitiveArrayList.remove(element: Double): Boolean = + when (state) { + DOUBLE -> (arrayList as DoubleArrayList).rem(element) + else -> false + } + +internal operator fun PrimitiveArrayList.minusAssign(element: Boolean) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Byte) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Char) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Short) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Int) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Long) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Float) { + remove(element) +} + +internal operator fun PrimitiveArrayList.minusAssign(element: Double) { + remove(element) +} + +// endregion + +public fun main() { + val a = PrimitiveArrayList(intArrayOf(1, 2, 3)) + a -= 1 +} diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt index f758360d1..0ed6aa977 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ValueColumnImpl.kt @@ -1,27 +1,34 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnResolutionContext import org.jetbrains.kotlinx.dataframe.columns.ValueColumn +import org.jetbrains.kotlinx.dataframe.toColumnDataHolder import kotlin.reflect.KType import kotlin.reflect.full.withNullability internal open class ValueColumnImpl( - values: List, + values: ColumnDataHolder, name: String, type: KType, val defaultValue: T? = null, - distinct: Lazy>? = null, -) : DataColumnImpl(values, name, type, distinct), +) : DataColumnImpl(values, name, type), ValueColumn { - override fun distinct() = ValueColumnImpl(toSet().toList(), name, type, defaultValue, distinct) + override fun distinct() = + ValueColumnImpl( + values = toSet().toColumnDataHolder(type, distinct), + name = name, + type = type, + defaultValue = defaultValue, + ) - override fun rename(newName: String) = ValueColumnImpl(values, newName, type, defaultValue, distinct) + override fun rename(newName: String) = ValueColumnImpl(values, newName, type, defaultValue) - override fun changeType(type: KType) = ValueColumnImpl(values, name, type, defaultValue, distinct) + override fun changeType(type: KType) = ValueColumnImpl(values, name, type, defaultValue) override fun addParent(parent: ColumnGroup<*>): DataColumn = ValueColumnWithParent(parent, this) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt index bb9fcc8ab..7f2f03926 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt @@ -3,6 +3,7 @@ package org.jetbrains.kotlinx.dataframe.impl.columns import org.jetbrains.kotlinx.dataframe.AnyCol import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder import org.jetbrains.kotlinx.dataframe.ColumnsContainer import org.jetbrains.kotlinx.dataframe.ColumnsSelector import org.jetbrains.kotlinx.dataframe.DataColumn @@ -92,7 +93,7 @@ internal fun ColumnsContainer.newColumnWithActualType( internal fun computeValues(df: DataFrame, expression: AddExpression): Pair> { var nullable = false - val list = ArrayList(df.nrow) + val list = ColumnDataHolder.empty(df.nrow) df.indices().forEach { val row = AddDataRowImpl(it, df, list) val value = expression(row, row) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt index a5e745c4f..544dfb144 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlinx.dataframe.codeGen.DefaultReadDfMethod import org.jetbrains.kotlinx.dataframe.impl.ColumnNameGenerator import org.jetbrains.kotlinx.dataframe.impl.api.Parsers import org.jetbrains.kotlinx.dataframe.impl.api.parse +import org.jetbrains.kotlinx.dataframe.impl.createDataCollector import org.jetbrains.kotlinx.dataframe.values import java.io.BufferedReader import java.io.File @@ -377,6 +378,94 @@ public fun DataFrame.Companion.readDelim( return cols.toDataFrame() } +public fun DataFrame.Companion.readDelimApacheSequential( + reader: Reader, + format: CSVFormat = CSVFormat.DEFAULT.builder() + .setHeader() + .build(), + colTypes: Map = mapOf(), + skipLines: Int = 0, + readLines: Int? = null, + parserOptions: ParserOptions? = null, +): AnyFrame { + var reader = reader + if (skipLines > 0) { + reader = BufferedReader(reader) + repeat(skipLines) { reader.readLine() } + } + + val csvParser = format.parse(reader) + val records = if (readLines == null) { + csvParser.iterator() + } else { + require(readLines >= 0) { "`readLines` must not be negative" } + val iter = csvParser.iterator() + var count = readLines ?: 0 + iterator { + while (iter.hasNext() && 0 < count--) { + yield(iter.next()) + } + } + } + + var firstRow = if (records.hasNext()) records.next() else null + val columnNames = csvParser.headerNames.takeIf { it.isNotEmpty() } + ?: (1..(firstRow?.count() ?: 0)).map { index -> "X$index" } + + val generator = ColumnNameGenerator() + val uniqueNames = columnNames.map { generator.addUnique(it) } + + val columnCollectors = uniqueNames.map { _ -> + createDataCollector(type = typeOf()) + } + + if (firstRow != null) { + for ((i, col) in columnCollectors.withIndex()) { + if (firstRow.isSet(i)) { + val value = firstRow[i] + if (value.isEmpty()) { + col.add(null) + } else { + col.add(value) + } + } else { + col.add(null) + } + } + } + while (records.hasNext()) { + val row = records.next() + for ((i, col) in columnCollectors.withIndex()) { + if (row.isSet(i)) { + val value = row[i] + if (value.isEmpty()) { + col.add(null) + } else { + col.add(value) + } + } else { + col.add(null) + } + } + } + + val defaultColType = colTypes[".default"] + val cols = columnCollectors.mapIndexed { i, col -> + val colName = uniqueNames[i] + val column = col.toColumn(colName) // already infers nullability + + when (val colType = colTypes[colName] ?: defaultColType) { + null -> column.tryParse(parserOptions) + + else -> { + val parser = Parsers[colType.toType()]!! + column.parse(parser, parserOptions) + } + } + } + return cols.toDataFrame() +} + public fun AnyFrame.writeCSV(file: File, format: CSVFormat = CSVFormat.DEFAULT): Unit = writeCSV(FileWriter(file), format) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/deephavenCsv.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/deephavenCsv.kt new file mode 100644 index 000000000..df9d4add8 --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/deephavenCsv.kt @@ -0,0 +1,568 @@ +package org.jetbrains.kotlinx.dataframe.io + +import io.deephaven.csv.CsvSpecs +import io.deephaven.csv.parsers.DataType +import io.deephaven.csv.parsers.Parser +import io.deephaven.csv.parsers.Parsers +import io.deephaven.csv.reading.CsvReader +import io.deephaven.csv.sinks.Sink +import io.deephaven.csv.sinks.SinkFactory +import io.deephaven.csv.sinks.Source +import it.unimi.dsi.fastutil.ints.IntAVLTreeSet +import it.unimi.dsi.fastutil.ints.IntSortedSet +import kotlinx.datetime.Instant +import kotlinx.datetime.LocalDate +import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.toKotlinLocalDateTime +import org.jetbrains.kotlinx.dataframe.AnyFrame +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder +import org.jetbrains.kotlinx.dataframe.DataColumn +import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.api.ParserOptions +import org.jetbrains.kotlinx.dataframe.api.print +import org.jetbrains.kotlinx.dataframe.api.toDataFrame +import org.jetbrains.kotlinx.dataframe.api.tryParse +import org.jetbrains.kotlinx.dataframe.columns.ValueColumn +import org.jetbrains.kotlinx.dataframe.impl.api.parse +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderImpl +import org.jetbrains.kotlinx.dataframe.impl.columns.PrimitiveArrayList +import org.jetbrains.kotlinx.dataframe.impl.columns.get +import org.jetbrains.kotlinx.dataframe.impl.columns.getArrayList +import org.jetbrains.kotlinx.dataframe.impl.columns.zeroValueFor +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.BOOLEAN +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.BYTE +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.CHAR +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.DOUBLE +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.FLOAT +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.INT +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.LONG +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.SHORT +import org.jetbrains.kotlinx.dataframe.io.DeepHavenColumnDataHolderImpl.SinkState.STRING +import java.io.File +import java.io.InputStream +import java.time.ZoneOffset +import kotlin.reflect.KType +import kotlin.reflect.full.withNullability +import kotlin.reflect.typeOf +import kotlin.time.Duration.Companion.nanoseconds +import java.time.LocalDateTime as JavaLocalDateTime + +public fun main() { + val folder = File( + "/mnt/data/Download/Age-sex-by-ethnic-group-grouped-total-responses-census-usually-resident-population-counts-2006-2013-2018-Censuses-RC-TA-SA2-DHB", + ) + val mediumFile = File(folder, "DimenLookupArea8277.csv") + val largeFile = File(folder, "Data8277.csv") + +// val file = mediumFile + val file = largeFile + + val df1 = DataFrame.readDelimDeephavenCsv(file.inputStream()) + .also { it.print(borders = true, columnTypes = true, rowsLimit = 20) } +} + +public fun DataFrame.Companion.readDelimDeephavenCsv( + inputStream: InputStream, + header: List? = null, + colTypes: Map = mapOf(), + firstLineIsHeader: Boolean = true, + readLines: Long? = null, + parserOptions: ParserOptions = ParserOptions(), +): AnyFrame { + val specs = CsvSpecs.builder() + .hasHeaderRow(firstLineIsHeader) + .let { if (header == null) it else it.headers(header) } + .let { if (readLines == null) it else it.numRows(readLines) } + .let { + if (colTypes.isEmpty()) { + it + } else { + colTypes.entries.fold(it) { it, (name, type) -> + it.putParserForName(name, type.toParser()) + } + } + } + .build() + + val parserOptions = parserOptions.copy( + parsersToSkip = parserOptions.parsersToSkip + + setOf( + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + typeOf(), + ), + ) + + val result = CsvReader.read(specs, inputStream, DeepHavenColumnDataHolderImpl.sinkFactory) + + val cols = result.map { + val data = it.data() as DeepHavenColumnDataHolderImpl<*> + + val type: KType + val columnData = when (it.dataType()) { + DataType.BOOLEAN_AS_BYTE -> { + data.replaceList { + it as PrimitiveArrayList + val oneByte = 1.toByte() + PrimitiveArrayList(BooleanArray(it.size) { i -> it[i] == oneByte }) + } + type = typeOf() + data + } + + DataType.BYTE -> { + type = typeOf() + data + } + + DataType.SHORT -> { + type = typeOf() + data + } + + DataType.INT -> { + type = typeOf() + data + } + + DataType.LONG -> { + type = typeOf() + data + } + + DataType.FLOAT -> { + type = typeOf() + data + } + + DataType.DOUBLE -> { + type = typeOf() + data + } + + DataType.DATETIME_AS_LONG, DataType.TIMESTAMP_AS_LONG -> { // TODO + data.replaceList { + it as PrimitiveArrayList + it.mapIndexed { index, long -> + if (data.isNull(index)) { + null + } else { + long.nanoseconds.toComponents { seconds, nanoseconds -> + JavaLocalDateTime.ofEpochSecond(seconds, nanoseconds, ZoneOffset.UTC) + }.toKotlinLocalDateTime() + } + }.toMutableList() + } + data.switchToBoxedList() + type = typeOf() + data + } + + DataType.CHAR -> { + type = typeOf() + data + } + + DataType.STRING -> { + type = typeOf() + data + } + + DataType.CUSTOM -> TODO() + + null -> error("null data type") + } + + val defaultColType = colTypes[".default"] + val colType = colTypes[it.name()] ?: defaultColType + + val hasNulls = data.hasNulls() + val column = DataColumn.createValueColumn(it.name(), columnData, type.withNullability(hasNulls)) + + if (it.dataType() == DataType.STRING) { + column as ValueColumn + when (colType) { + null -> column.tryParse(parserOptions) + + else -> { + val parser = org.jetbrains.kotlinx.dataframe.impl.api.Parsers[colType.toType()]!! + column.parse(parser, parserOptions) + } + } + } else { + column + } + } + return cols.toDataFrame() +} + +internal fun ColType.toParser(): Parser<*> = + when (this) { + ColType.Int -> Parsers.INT + ColType.Long -> Parsers.LONG + ColType.Double -> Parsers.DOUBLE + ColType.Boolean -> Parsers.BOOLEAN + ColType.BigDecimal -> TODO() + ColType.LocalDate -> TODO() + ColType.LocalTime -> TODO() + ColType.LocalDateTime -> Parsers.DATETIME + ColType.String -> Parsers.STRING + } + +internal class DeepHavenColumnDataHolderImpl( + list: MutableList = PrimitiveArrayList() as MutableList, + distinct: Lazy>? = null, + zeroValue: Any? = Undefined, + nullIndices: IntSortedSet = IntAVLTreeSet(), + val columnIndex: Int, + private val sinkState: SinkState, +) : ColumnDataHolderImpl( + list = list, + distinct = distinct, + zeroValue = zeroValue, + nullIndices = nullIndices, + ), + Sink, + Source { + + companion object { + @Suppress("UNCHECKED_CAST") + val sinkFactory: SinkFactory = SinkFactory.ofSimple( + // byteSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toByte()), + columnIndex = it, + sinkState = BYTE, + ) as Sink + }, + // shortSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toShort()), + columnIndex = it, + sinkState = SHORT, + ) as Sink + }, + // intSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toInt()), + columnIndex = it, + sinkState = INT, + ) as Sink + }, + // longSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toLong()), + columnIndex = it, + sinkState = LONG, + ) as Sink + }, + // floatSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toFloat()), + columnIndex = it, + sinkState = FLOAT, + ) as Sink + }, + // doubleSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toDouble()), + columnIndex = it, + sinkState = DOUBLE, + ) as Sink + }, + // booleanAsByteSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toByte()), + columnIndex = it, + sinkState = BYTE, + ) as Sink + }, + // charSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toChar()), + columnIndex = it, + sinkState = CHAR, + ) as Sink + }, + // stringSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(""), + columnIndex = it, + sinkState = STRING, + ) as Sink> + }, + // dateTimeAsLongSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toLong()), + columnIndex = it, + sinkState = LONG, + ) as Sink + }, + // timestampAsLongSinkSupplier = + { + DeepHavenColumnDataHolderImpl( + zeroValue = zeroValueFor(0.toLong()), + columnIndex = it, + sinkState = LONG, + ) as Sink + }, + ) + } + + enum class SinkState { + BOOLEAN, + BYTE, + SHORT, + INT, + LONG, + FLOAT, + DOUBLE, + CHAR, + STRING, + ; + + fun matches(primitiveArrayListState: PrimitiveArrayList.State?) = + when (this) { + BOOLEAN -> primitiveArrayListState == PrimitiveArrayList.State.BOOLEAN + BYTE -> primitiveArrayListState == PrimitiveArrayList.State.BYTE + SHORT -> primitiveArrayListState == PrimitiveArrayList.State.SHORT + INT -> primitiveArrayListState == PrimitiveArrayList.State.INT + LONG -> primitiveArrayListState == PrimitiveArrayList.State.LONG + FLOAT -> primitiveArrayListState == PrimitiveArrayList.State.FLOAT + DOUBLE -> primitiveArrayListState == PrimitiveArrayList.State.DOUBLE + CHAR -> primitiveArrayListState == PrimitiveArrayList.State.CHAR + STRING -> false + } + } + + /** + * Replaces the list with the given list. + * CAREFUL: nulls are not updated. + */ + fun replaceList(updateList: (MutableList) -> MutableList<*>) { + list = updateList(list) as MutableList + } + + override fun read( + dest: Any, + isNull: BooleanArray, + srcBegin: Long, + srcEnd: Long, + ) { + if (srcBegin == srcEnd) return + val srcBeginAsInt = srcBegin.toInt() + val srcEndAsInt = srcEnd.toInt() + val srcSize = (srcEnd - srcBegin).toInt() + if (!usesPrimitiveArrayList) error("Unsupported as source") + when (sinkState) { + BYTE -> + (list as PrimitiveArrayList) + .getArrayList() + .getElements(srcBeginAsInt, dest as ByteArray, 0, srcSize) + + SHORT -> + (list as PrimitiveArrayList) + .getArrayList() + .getElements(srcBeginAsInt, dest as ShortArray, 0, srcSize) + + INT -> + (list as PrimitiveArrayList) + .getArrayList() + .getElements(srcBeginAsInt, dest as IntArray, 0, srcSize) + + LONG -> + (list as PrimitiveArrayList) + .getArrayList() + .getElements(srcBeginAsInt, dest as LongArray, 0, srcSize) + + else -> error("Unsupported as source") + } + + isNull.fill(false) + nullIndices.subSet(srcBeginAsInt, srcEndAsInt).forEach { + isNull[it - srcBeginAsInt] = true + } + } + + override fun write( + src: Any, + isNull: BooleanArray, + destBegin: Long, + destEnd: Long, + appending: Boolean, + ) { + if (destBegin == destEnd) return + val destBeginAsInt = destBegin.toInt() + val destSize = (destEnd - destBegin).toInt() + if (appending) { + writeAppending(destBegin, destEnd, isNull, src, destBeginAsInt, destSize) + } else { + writeReplacing(destBeginAsInt, src, destSize, destBegin, destEnd, isNull) + } + } + + @Suppress("UNCHECKED_CAST") + private fun writeReplacing( + destBeginAsInt: Int, + src: Any, + destSize: Int, + destBegin: Long, + destEnd: Long, + isNull: BooleanArray, + ) { + when (sinkState) { + BOOLEAN -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as BooleanArray, 0, destSize) + + BYTE -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as ByteArray, 0, destSize) + + SHORT -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as ShortArray, 0, destSize) + + INT -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as IntArray, 0, destSize) + + LONG -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as LongArray, 0, destSize) + + FLOAT -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as FloatArray, 0, destSize) + + DOUBLE -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as DoubleArray, 0, destSize) + + CHAR -> (list as PrimitiveArrayList) + .getArrayList() + .setElements(destBeginAsInt, src as CharArray, 0, destSize) + + else -> (list as MutableList).let { + for ((srcIndex, destIndex) in (destBegin..)[srcIndex] + } + } + } + } + + for ((srcIndex, destIndex) in (destBegin..).state)) { + for ((srcIndex, _) in (destBegin.. add((src as BooleanArray)[srcIndex]) + BYTE -> add((src as ByteArray)[srcIndex]) + SHORT -> add((src as ShortArray)[srcIndex]) + INT -> add((src as IntArray)[srcIndex]) + LONG -> add((src as LongArray)[srcIndex]) + FLOAT -> add((src as FloatArray)[srcIndex]) + DOUBLE -> add((src as DoubleArray)[srcIndex]) + CHAR -> add((src as CharArray)[srcIndex]) + STRING -> add((src as Array)[srcIndex] as T) + } + } + } + return + } else { // can use array copy + when (sinkState) { + BOOLEAN -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as BooleanArray, 0, destSize) + + BYTE -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as ByteArray, 0, destSize) + + SHORT -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as ShortArray, 0, destSize) + + INT -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as IntArray, 0, destSize) + + LONG -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as LongArray, 0, destSize) + + FLOAT -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as FloatArray, 0, destSize) + + DOUBLE -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as DoubleArray, 0, destSize) + + CHAR -> (list as PrimitiveArrayList) + .getArrayList() + .addElements(destBeginAsInt, src as CharArray, 0, destSize) + + else -> (list as MutableList).let { + for ((srcIndex, _) in (destBegin..)[srcIndex]) + } + } + } + } + + for ((srcIndex, destIndex) in (destBegin.. = this +} diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/csvBenchmark.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/csvBenchmark.kt new file mode 100644 index 000000000..d596b7797 --- /dev/null +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/csvBenchmark.kt @@ -0,0 +1,52 @@ +package org.jetbrains.kotlinx.dataframe + +import kotlinx.benchmark.Benchmark +import kotlinx.benchmark.BenchmarkMode +import kotlinx.benchmark.Measurement +import kotlinx.benchmark.Mode +import kotlinx.benchmark.Scope +import kotlinx.benchmark.Setup +import kotlinx.benchmark.State +import kotlinx.benchmark.Warmup +import org.jetbrains.kotlinx.dataframe.io.readDelim +import org.jetbrains.kotlinx.dataframe.io.readDelimApacheSequential +import org.jetbrains.kotlinx.dataframe.io.readDelimDeephavenCsv +import org.openjdk.jmh.annotations.Fork +import java.io.File +import java.io.InputStream +import java.io.Reader +import java.util.concurrent.TimeUnit + +@State(Scope.Benchmark) +@Fork(1) +@Warmup(iterations = 10) +@BenchmarkMode(Mode.SingleShotTime) +@Measurement(iterations = 10, timeUnit = java.util.concurrent.TimeUnit.MILLISECONDS) +open class CsvBenchmark { + + val mediumFile = File( + "/mnt/data/Download/Age-sex-by-ethnic-group-grouped-total-responses-census-usually-resident-population-counts-2006-2013-2018-Censuses-RC-TA-SA2-DHB/DimenLookupArea8277.csv", + ) + + val file = mediumFile +// val file = largeFile + +// @Setup +// fun setUp() { +// } + +// @Benchmark + fun apacheCsvReader() { + DataFrame.readDelim(file.reader()) + } + +// @Benchmark + fun apacheCsvReaderSequential() { + DataFrame.readDelimApacheSequential(file.reader()) + } + + @Benchmark + fun deephavenCsvReader() { + DataFrame.readDelimDeephavenCsv(file.inputStream()) + } +} diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolder.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolder.kt new file mode 100644 index 000000000..439bc17bf --- /dev/null +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/ColumnDataHolder.kt @@ -0,0 +1,373 @@ +package org.jetbrains.kotlinx.dataframe.impl.columns + +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.matchers.collections.shouldContainInOrder +import io.kotest.matchers.shouldBe +import org.jetbrains.kotlinx.dataframe.ColumnDataHolder +import org.jetbrains.kotlinx.dataframe.DataColumn +import org.jetbrains.kotlinx.dataframe.annotations.DataSchema +import org.jetbrains.kotlinx.dataframe.api.DataSchemaEnum +import org.jetbrains.kotlinx.dataframe.api.add +import org.jetbrains.kotlinx.dataframe.api.aggregate +import org.jetbrains.kotlinx.dataframe.api.cast +import org.jetbrains.kotlinx.dataframe.api.column +import org.jetbrains.kotlinx.dataframe.api.dataFrameOf +import org.jetbrains.kotlinx.dataframe.api.drop +import org.jetbrains.kotlinx.dataframe.api.fillNulls +import org.jetbrains.kotlinx.dataframe.api.filter +import org.jetbrains.kotlinx.dataframe.api.groupBy +import org.jetbrains.kotlinx.dataframe.api.map +import org.jetbrains.kotlinx.dataframe.api.print +import org.jetbrains.kotlinx.dataframe.api.replace +import org.jetbrains.kotlinx.dataframe.api.sortBy +import org.jetbrains.kotlinx.dataframe.api.toDataFrame +import org.jetbrains.kotlinx.dataframe.api.with +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.BOXED_ARRAY +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.BOXED_ARRAY_WITH_NULL +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.COLLECTOR +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.DOUBLE_ARRAY +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.LIST +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.LIST_WITH_NULL +import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnDataHolderTests.ColumnType.NON_PRIMITIVE +import org.jetbrains.kotlinx.dataframe.impl.createDataCollector +import org.jetbrains.kotlinx.dataframe.math.mean +import org.junit.Ignore +import org.junit.Test +import org.openjdk.jol.info.GraphLayout +import kotlin.random.Random +import kotlin.reflect.typeOf +import kotlin.time.Duration +import kotlin.time.measureTime +import kotlin.time.measureTimedValue + +// @Ignore +class ColumnDataHolderTests { + + enum class ColumnType(override val value: String) : DataSchemaEnum { + LIST("list"), + LIST_WITH_NULL("list with null"), + BOXED_ARRAY("boxed array"), + BOXED_ARRAY_WITH_NULL("boxed array with null"), + DOUBLE_ARRAY("double array"), + COLLECTOR("collector"), + NON_PRIMITIVE("non-primitive"), + } + + @DataSchema + data class Result( + val type: ColumnType, + val creationTime: Duration, + val processingTime: Duration, + val size: Long, + ) + + // 5M rows, mutable ColumnDataHolder, also in Column Data Collector + // ⌌------------------------------------------------------------------⌍ + // | | type| creation| processing| size| + // |--|----------------------|-------------|-------------|------------| + // | 0| BOXED_ARRAY_WITH_NULL| 2.954687548s| 2.743710069s| 372,773,032| + // | 1| COLLECTOR| 5.111297654s| 2.992183792s| 380,323,708| + // | 2| LIST_WITH_NULL| 3.941255533s| 3.159062938s| 372,454,737| + // | 3| NON_PRIMITIVE| 3.735666737s| 3.330158776s| 492,572,326| + // | 4| DOUBLE_ARRAY| 288.513615ms| 8.085407327s| 132,513,736| + // | 5| LIST| 744.363739ms| 9.264420569s| 132,590,481| + // | 6| BOXED_ARRAY| 705.545507ms| 9.365372480s| 132,505,768| + // ⌎------------------------------------------------------------------⌏ + // same on master: + // ⌌-----------------------------------------------------------⌍ + // | | type| creation| processing| size| + // |--|---------------|-------------|-------------|------------| + // | 0| COLLECTOR| 2.370049848s| 1.794743904s| 254,129,245| + // | 1| LIST_WITH_NULL| 780.404256ms| 2.071586752s| 250,365,329| + // | 2| NON_PRIMITIVE| 595.397324ms| 3.481924785s| 250,349,159| + // | 3| LIST| 483.394463ms| 8.160207220s| 430,403,480| + // ⌎-----------------------------------------------------------⌏ + @Ignore + @Test + fun `measuring speed of ColumnDataHolder creation`() { + val size = 5e6.toInt() + val content = { i: Int -> Random.nextDouble() } + val nullableContent = { i: Int -> + if (Random.nextBoolean()) { + null + } else { + Random.nextDouble() + } + } + val tests = buildList { + repeat(5) { + add(LIST) + add(LIST_WITH_NULL) + add(BOXED_ARRAY) + add(BOXED_ARRAY_WITH_NULL) + add(DOUBLE_ARRAY) + add(COLLECTOR) + add(NON_PRIMITIVE) + } + }.shuffled() + + val results = mutableListOf() + + val a by column() + val b by column() + val c by column() + val d by column() + + for ((i, test) in tests.withIndex()) { + println("running test [$i/${tests.lastIndex}]") + val (df, time1) = measureTimedValue { + when (test) { + LIST -> dataFrameOf( + DataColumn.createValueColumn(a.name(), List(size, content)), + DataColumn.createValueColumn(b.name(), List(size, content)), + DataColumn.createValueColumn(c.name(), List(size, content)), + ) + + NON_PRIMITIVE -> dataFrameOf( + DataColumn.createValueColumn(a.name(), List(size, nullableContent) + (1 to 2)), + DataColumn.createValueColumn(b.name(), List(size, nullableContent) + (1 to 2)), + DataColumn.createValueColumn(c.name(), List(size, nullableContent) + (1 to 2)), + ) + + LIST_WITH_NULL -> dataFrameOf( + DataColumn.createValueColumn(a.name(), List(size, nullableContent)), + DataColumn.createValueColumn(b.name(), List(size, nullableContent)), + DataColumn.createValueColumn(c.name(), List(size, nullableContent)), + ) + + BOXED_ARRAY -> dataFrameOf( + DataColumn.createValueColumn(a.name(), Array(size, content)), + DataColumn.createValueColumn(b.name(), Array(size, content)), + DataColumn.createValueColumn(c.name(), Array(size, content)), + ) + + BOXED_ARRAY_WITH_NULL -> dataFrameOf( + DataColumn.createValueColumn(a.name(), Array(size, nullableContent)), + DataColumn.createValueColumn(b.name(), Array(size, nullableContent)), + DataColumn.createValueColumn(c.name(), Array(size, nullableContent)), + ) + + DOUBLE_ARRAY -> dataFrameOf( + DataColumn.createValueColumn(a.name(), DoubleArray(size, content)), + DataColumn.createValueColumn(b.name(), DoubleArray(size, content)), + DataColumn.createValueColumn(c.name(), DoubleArray(size, content)), + ) + + COLLECTOR -> dataFrameOf( + createDataCollector().also { cdc -> + repeat(size) { cdc.add(nullableContent(it)) } + }.toColumn(a.name()), + createDataCollector().also { cdc -> + repeat(size) { cdc.add(nullableContent(it)) } + }.toColumn(b.name()), + createDataCollector().also { cdc -> + repeat(size) { cdc.add(nullableContent(it)) } + }.toColumn(c.name()), + ) + } + } + + df.columns().forEach { + ((it as DataColumnImpl<*>).values as ColumnDataHolderImpl<*>) + .usesPrimitiveArrayList shouldBe (test != NON_PRIMITIVE) + } + + val time2 = measureTime { + df.drop { "a"() !is Double || "b"() !is Double || "c"() !is Double } + .fillNulls { a and b and c }.with { 0.0 } + .filter { a() > b() } + .add(d) { a() + b() + c() } + } + + val footprint = try { + GraphLayout.parseInstance(df).toFootprint() + } catch (e: Throwable) { + throw Exception("failed test: $test", e) + } + val size = footprint.lines() + .last { "total" in it } + .split(" ") + .mapNotNull { it.toLongOrNull() } + .last() + + results += Result(test, time1, time2, size) + } + + val creation by column() + val processing by column() + + results.toDataFrame() + .groupBy { type } + .aggregate { + creationTime.toList().mean() into creation + processingTime.toList().mean() into processing + this.size.toList().mean() into "size" + } + .add("total") { creation() + processing() } + .sortBy { "processing"() } + .replace { this.size.cast() }.with { + it.map { + it.toLong().toString() + .reversed() + .chunked(3) + .reversed() + .joinToString(",") { it.reversed() } + } + } + .print(borders = true, title = true) + + results + } + + fun Collection.mean(): Duration = reduce { acc, duration -> acc + duration } / size + + @Ignore + @Test + fun `create large columns`() { + val size = 100_000_000 + val content = { i: Int -> Random.nextDouble() } + val nullableContent = { i: Int -> + if (Random.nextBoolean()) { + null + } else { + Random.nextDouble() + } + } + val df = dataFrameOf( + DataColumn.createValueColumn("a", DoubleArray(size, content)), + DataColumn.createValueColumn("b", DoubleArray(size, content)), + DataColumn.createValueColumn("c", DoubleArray(size, content)), + ) + + df.print() + } + + @Test + fun `create all types of columns`() { + ColumnDataHolder.of(intArrayOf(1, 2, 3), INT).let { + it shouldContainInOrder listOf(1, 2, 3) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe true + } + ColumnDataHolder.of(arrayOf(1, 2, 3), INT).let { + it shouldContainInOrder listOf(1, 2, 3) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe true + } + ColumnDataHolder.of(arrayOf(1, 2, null), NULLABLE_INT).let { + it shouldContainInOrder listOf(1, 2, null) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe true + } + ColumnDataHolder.of(listOf(1, 2, null), NULLABLE_INT).let { + it shouldContainInOrder listOf(1, 2, null) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe true + } + ColumnDataHolder.of(listOf(1, 2, null), NULLABLE_INT).let { + it shouldContainInOrder listOf(1, 2, null) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe true + } + ColumnDataHolder.of( + any = listOf(Pair(1, 2), null, emptyList()), + type = NULLABLE_ANY, + ).let { + it shouldContainInOrder listOf(Pair(1, 2), null, emptyList()) + (it as ColumnDataHolderImpl<*>).usesPrimitiveArrayList shouldBe false + } + } + + @Test + fun `create typed ColumnDataHolder by collecting values`() { + val holder = ColumnDataHolder.emptyForType(NULLABLE_INT) + holder.canAddPrimitively(3.0) shouldBe false + holder.add(1) + holder.add(2) + holder.add(null) + holder.canAddPrimitively(3.0) shouldBe false + holder.add(3) + holder shouldContainInOrder listOf(1, 2, null, 3) + } + + @Test + fun `create untyped ColumnDataHolder by collecting values`() { + val holder = ColumnDataHolder.empty() + holder.add(1) + holder.add(2) + holder.usesPrimitiveArrayList shouldBe true + holder.add(null) + holder.usesPrimitiveArrayList shouldBe true + holder.canAddPrimitively(3.0) shouldBe false + holder.add(3.0) // should switch to mutableList here + holder.usesPrimitiveArrayList shouldBe false + holder.canAddPrimitively(3.0) shouldBe false + holder.add(3) + holder.usesPrimitiveArrayList shouldBe false + holder.add(null) + holder shouldContainInOrder listOf(1, 2, null, 3, null) + } + + @Test + fun `just nulls`() { + val holder = ColumnDataHolder.empty() + holder.add(null) + holder.add(null) + holder.add(null) + holder.usesPrimitiveArrayList shouldBe true + holder shouldContainInOrder listOf(null, null, null) + + holder.add(1) + holder.usesPrimitiveArrayList shouldBe true + holder shouldContainInOrder listOf(null, null, null, 1) + } + + @Test + fun `just nulls non-primitive type`() { + val holder = ColumnDataHolder.empty() + holder.add(null) + holder.add(null) + holder.add(null) + holder.usesPrimitiveArrayList shouldBe true + holder shouldContainInOrder listOf(null, null, null) + + holder.add(1 to 2) + holder.usesPrimitiveArrayList shouldBe false + holder shouldContainInOrder listOf(null, null, null, 1 to 2) + } + + @Test + fun `just nulls typed`() { + val holder = ColumnDataHolder.emptyForType(typeOf()) + holder.add(null) + holder.add(null) + holder.add(null) + holder.usesPrimitiveArrayList shouldBe true + holder shouldContainInOrder listOf(null, null, null) + + holder.add(1) + holder.usesPrimitiveArrayList shouldBe true + holder shouldContainInOrder listOf(null, null, null, 1) + } + + @Test + fun `setting test`() { + val holder = ColumnDataHolder.empty() + shouldThrow { holder[0] = 1.0 } + holder.size shouldBe 0 + holder.usesPrimitiveArrayList shouldBe true + holder.add(null) + holder.size shouldBe 1 + holder.usesPrimitiveArrayList shouldBe true + holder[0] = 1.0 + holder.size shouldBe 1 + holder.usesPrimitiveArrayList shouldBe true + holder.add(2.0) + holder.size shouldBe 2 + holder.usesPrimitiveArrayList shouldBe true + holder[0] = 1 + holder.size shouldBe 2 + holder.usesPrimitiveArrayList shouldBe false + } + + @Test + fun temp() { + val holder = PrimitiveArrayList(12) + holder.initCapacity shouldBe 12 + } +} diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt new file mode 100644 index 000000000..75584f832 --- /dev/null +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/PrimitiveArrayList.kt @@ -0,0 +1,51 @@ +package org.jetbrains.kotlinx.dataframe.impl.columns + +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.matchers.shouldBe +import org.junit.Test + +class PrimitiveArrayListTests { + + @Test + fun `test primitive array list`() { + val list = PrimitiveArrayList() as PrimitiveArrayList + list.addBoxed(1) + shouldThrow { list.remove(2.0) } + list.addAll(listOf(2, 3)) + + (list as PrimitiveArrayList).toIntArray() shouldBe intArrayOf(1, 2, 3) + } + + @Test + fun `test empty primitive array list`() { + val list = PrimitiveArrayList() + list.isEmpty() shouldBe true + list.size shouldBe 0 + + list.removeBoxed(1234) shouldBe false + list.remove(1234.2) shouldBe false + + list.addBoxed(1) + list.canAdd(1) shouldBe true + list.canAdd(1.0) shouldBe false + + shouldThrow { list.addBoxed(1.0) } + + list.isEmpty() shouldBe false + list.size shouldBe 1 + list.clear() + list.isEmpty() shouldBe true + list.size shouldBe 0 + + list.state shouldBe PrimitiveArrayList.State.INT + } + + @Test + fun `test specific primitive array list`() { + val list = PrimitiveArrayList() + list += 1 + list += 2 + list += 3 + list.toIntArray() shouldBe intArrayOf(1, 2, 3) + } +} diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/largeCsvBenchmark.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/largeCsvBenchmark.kt new file mode 100644 index 000000000..05232da50 --- /dev/null +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/largeCsvBenchmark.kt @@ -0,0 +1,52 @@ +package org.jetbrains.kotlinx.dataframe + +import kotlinx.benchmark.Benchmark +import kotlinx.benchmark.BenchmarkMode +import kotlinx.benchmark.Measurement +import kotlinx.benchmark.Mode +import kotlinx.benchmark.Scope +import kotlinx.benchmark.Setup +import kotlinx.benchmark.State +import kotlinx.benchmark.Warmup +import org.jetbrains.kotlinx.dataframe.io.readDelim +import org.jetbrains.kotlinx.dataframe.io.readDelimApacheSequential +import org.jetbrains.kotlinx.dataframe.io.readDelimDeephavenCsv +import org.openjdk.jmh.annotations.Fork +import java.io.File +import java.io.InputStream +import java.io.Reader +import java.util.concurrent.TimeUnit + +@State(Scope.Benchmark) +@Fork(1) +@Warmup(iterations = 5) +@BenchmarkMode(Mode.SingleShotTime) +@Measurement(iterations = 5, timeUnit = TimeUnit.SECONDS) +open class LargeCsvBenchmark { + + val largeFile = File( + "/mnt/data/Download/Age-sex-by-ethnic-group-grouped-total-responses-census-usually-resident-population-counts-2006-2013-2018-Censuses-RC-TA-SA2-DHB/Data8277.csv", + ) + + val file = largeFile +// val file = largeFile + +// @Setup +// fun setUp() { +// } + +// @Benchmark + fun apacheCsvReader() { + DataFrame.readDelim(file.reader()) + } + +// @Benchmark + fun apacheCsvReaderSequential() { + DataFrame.readDelimApacheSequential(file.reader()) + } + + @Benchmark + fun deephavenCsvReader() { + DataFrame.readDelimDeephavenCsv(file.inputStream()) + } +}