Skip to content

Commit a306223

Browse files
add shortcuts
1 parent 0f6b8be commit a306223

File tree

1 file changed

+40
-0
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+40
-0
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/move.kt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,17 @@ public fun <T> DataFrame<T>.moveToLeft(columns: ColumnsSelector<T, *>): DataFram
312312
@Interpretable("MoveToStart1")
313313
public fun <T> DataFrame<T>.moveToStart(columns: ColumnsSelector<T, *>): DataFrame<T> = move(columns).toStart()
314314

315+
/**
316+
* @include [CommonMoveToStartDocs]
317+
* @include [SelectingColumns.Dsl.WithExample] {@include [SetMoveToStartOperationArg]}
318+
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to move.
319+
* @param [insideGroup] If true, selected columns will be moved to the start remaining inside their group,
320+
* else they will be moved to the start of the top level.
321+
*/
322+
@Refine
323+
@Interpretable("MoveToStart1")
324+
public fun <T> DataFrame<T>.moveToStart(columns: ColumnsSelector<T, *>, insideGroup: Boolean): DataFrame<T> = move(columns).toStart(insideGroup)
325+
315326
@Deprecated(MOVE_TO_LEFT, ReplaceWith(MOVE_TO_LEFT_REPLACE), DeprecationLevel.ERROR)
316327
public fun <T> DataFrame<T>.moveToLeft(vararg columns: String): DataFrame<T> = moveToStart { columns.toColumnSet() }
317328

@@ -322,6 +333,15 @@ public fun <T> DataFrame<T>.moveToLeft(vararg columns: String): DataFrame<T> = m
322333
*/
323334
public fun <T> DataFrame<T>.moveToStart(vararg columns: String): DataFrame<T> = moveToStart { columns.toColumnSet() }
324335

336+
/**
337+
* @include [CommonMoveToStartDocs]
338+
* @include [SelectingColumns.ColumnNames.WithExample] {@include [SetMoveToStartOperationArg]}
339+
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to move.
340+
* @param [insideGroup] If true, selected columns will be moved to the start remaining inside their group,
341+
* else they will be moved to the start of the top level.
342+
*/
343+
public fun <T> DataFrame<T>.moveToStart(vararg columns: String, insideGroup: Boolean): DataFrame<T> = moveToStart ({ columns.toColumnSet() }, insideGroup)
344+
325345
@Deprecated(MOVE_TO_LEFT, ReplaceWith(MOVE_TO_LEFT_REPLACE), DeprecationLevel.ERROR)
326346
@AccessApiOverload
327347
public fun <T> DataFrame<T>.moveToLeft(vararg columns: AnyColumnReference): DataFrame<T> =
@@ -387,6 +407,17 @@ public fun <T> DataFrame<T>.moveToRight(columns: ColumnsSelector<T, *>): DataFra
387407
@Interpretable("MoveToEnd1")
388408
public fun <T> DataFrame<T>.moveToEnd(columns: ColumnsSelector<T, *>): DataFrame<T> = move(columns).toEnd()
389409

410+
/**
411+
* @include [CommonMoveToEndDocs]
412+
* @include [SelectingColumns.Dsl.WithExample] {@include [SetMoveToEndOperationArg]}
413+
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to move.
414+
* @param [insideGroup] If true, selected columns will be moved to the end remaining inside their group,
415+
* else they will be moved to the end of the top level.
416+
*/
417+
@Refine
418+
@Interpretable("MoveToEnd1")
419+
public fun <T> DataFrame<T>.moveToEnd(columns: ColumnsSelector<T, *>, insideGroup: Boolean): DataFrame<T> = move(columns).toEnd(insideGroup)
420+
390421
@Deprecated(MOVE_TO_RIGHT, ReplaceWith(MOVE_TO_RIGHT_REPLACE), DeprecationLevel.ERROR)
391422
public fun <T> DataFrame<T>.moveToRight(vararg columns: String): DataFrame<T> = moveToEnd { columns.toColumnSet() }
392423

@@ -397,6 +428,15 @@ public fun <T> DataFrame<T>.moveToRight(vararg columns: String): DataFrame<T> =
397428
*/
398429
public fun <T> DataFrame<T>.moveToEnd(vararg columns: String): DataFrame<T> = moveToEnd { columns.toColumnSet() }
399430

431+
/**
432+
* @include [CommonMoveToEndDocs]
433+
* @include [SelectingColumns.ColumnNames.WithExample] {@include [SetMoveToEndOperationArg]}
434+
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to move.
435+
* @param [insideGroup] If true, selected columns will be moved to the end remaining inside their group,
436+
* else they will be moved to the end of the top level.
437+
*/
438+
public fun <T> DataFrame<T>.moveToEnd(vararg columns: String, insideGroup: Boolean): DataFrame<T> = moveToEnd ({ columns.toColumnSet() }, insideGroup)
439+
400440
@Deprecated(MOVE_TO_RIGHT, ReplaceWith(MOVE_TO_RIGHT_REPLACE), DeprecationLevel.ERROR)
401441
@AccessApiOverload
402442
public fun <T> DataFrame<T>.moveToRight(vararg columns: AnyColumnReference): DataFrame<T> =

0 commit comments

Comments
 (0)