Skip to content

Commit 6f73354

Browse files
committed
small kdoc enhancements to clarify DataColumn.createX functions
1 parent e29991c commit 6f73354

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ public interface DataColumn<out T> : BaseColumn<T> {
100100
nullable: Boolean? = null,
101101
): DataColumn<T> = createColumnGuessingType(name, values, nullable = nullable)
102102

103+
/**
104+
* Calls [createColumnGroup], [createFrameColumn], or [createValueColumn] based on
105+
* [type] without checking the actual values in [values].
106+
*/
103107
public fun <T> create(
104108
name: String,
105109
values: List<T>,
@@ -112,6 +116,10 @@ public interface DataColumn<out T> : BaseColumn<T> {
112116
ColumnKind.Frame -> createFrameColumn(name, values as List<AnyFrame>).asDataColumn().cast()
113117
}
114118

119+
/**
120+
* Calls [createColumnGroup], [createFrameColumn], or [createValueColumn] based on
121+
* type [T] without checking the actual values in [values].
122+
*/
115123
public inline fun <reified T> create(name: String, values: List<T>, infer: Infer = Infer.None): DataColumn<T> =
116124
create(name, values, typeOf<T>(), infer)
117125

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnGroup.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import kotlin.reflect.KProperty
2323
* - [ColumnAccessor] created by [columnGroup] delegate
2424
* - explicit cast using [asColumnGroup]
2525
*
26+
* Can be instantiated by [DataColumn.createColumnGroup].
27+
*
2628
* @param T Schema marker. See [DataFrame] for details.
2729
*/
2830
@HasSchema(schemaArg = 0)

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/FrameColumn.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema
77
/**
88
* Column that stores values of type [DataFrame]
99
*
10+
* Can be instantiated by [DataColumn.createFrameColumn].
11+
*
1012
* @param T schema marker of contained dataframes. See [DataFrame] for details.
1113
*/
1214
public interface FrameColumn<out T> : DataColumn<DataFrame<T>> {

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ValueColumn.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import kotlin.reflect.KProperty
66
/**
77
* Column that stores values.
88
*
9+
* Can be instantiated by [DataColumn.createValueColumn].
10+
*
911
* @param T - type of values
1012
*/
1113
public interface ValueColumn<out T> : DataColumn<T> {

0 commit comments

Comments
 (0)