ColumnListImpl

internal class ColumnListImpl<C>(val columns: List<ColumnsResolver<C>>) : ColumnSet<C> , ColumnsList<C>

Constructors

Link copied to clipboard
constructor(columns: List<ColumnsResolver<C>>)
constructor(vararg columns: ColumnsResolver<C>)

Properties

Link copied to clipboard
open override val columns: List<ColumnsResolver<C>>

Functions

Link copied to clipboard
Link copied to clipboard
internal inline fun ColumnsResolver<*>.allAfterInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a new ColumnSet containing all columns after the first column that matches the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allBeforeInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a new ColumnSet containing all columns before the first column that satisfies the given predicate.

Link copied to clipboard

If this is a SingleColumn containing a single ColumnGroup (like SingleColumn<AnyRow> or ColumnsSelectionDsl), it returns a (transformable) ColumnSet containing the children of this ColumnGroup, else it simply returns a (transformable) ColumnSet from this (like when this is a ColumnSet).

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allFromInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a column set containing all columns from the internal column set that satisfy the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allUpToInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a ColumnSet containing all columns up to (and including) the first column that satisfies the given predicate.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "asNumbersAnyNullable")
fun ColumnSet<Any?>.asNumbers(): ColumnSet<Number?>
@JvmName(name = "asNumbersAny")
fun ColumnSet<Any>.asNumbers(): ColumnSet<Number>
Link copied to clipboard
Link copied to clipboard

Returns all columns inside this ColumnsResolver at any depth if they satisfy the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.colsInternal(crossinline predicate: ColumnFilter<*>): TransformableColumnSet<*>

If this ColumnsResolver is a SingleColumn, it returns a new ColumnSet containing the columns inside of this SingleColumn that match the given predicate.

Link copied to clipboard
inline fun <reified C> ColumnSet<*>.colsOf(noinline filter: (ColumnWithPath<C>) -> Boolean = { true }): ColumnSet<C>
fun <C> ColumnSet<*>.colsOf(type: KType, filter: (ColumnWithPath<C>) -> Boolean = { true }): ColumnSet<C>

Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.

Link copied to clipboard
internal inline fun <C> ColumnsResolver<*>.colsOfInternal(type: KType, crossinline filter: ColumnFilter<C>): TransformableColumnSet<C>

If this ColumnsResolver is a SingleColumn, it returns a new ColumnSet containing the columns inside of this SingleColumn that match the given filter and are the given type.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.columnGroupsInternal(crossinline filter: (ColumnGroup<*>) -> Boolean): ColumnSet<DataRow<*>>

Returns a ColumnSet containing the column groups that satisfy the given filter.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.columnsOfKindInternal(kinds: Set<ColumnKind>, crossinline filter: ColumnFilter<*>): TransformableColumnSet<*>

Returns a TransformableColumnSet containing the columns of given kind(s) that satisfy the given filter.

Link copied to clipboard
internal fun <C> ColumnSet<C>.exceptInternal(other: ColumnsResolver<*>): ColumnSet<C>

Removes the columns in the "other" ColumnsResolver from the current ColumnSet while keeping the structure intact. Returns a new ColumnSet with the remaining columns.

Link copied to clipboard
Link copied to clipboard
internal fun ColumnsResolver<*>.flattenRecursively(includeGroups: Boolean = true, includeTopLevel: Boolean = true): ColumnsResolver<*>

Flattens a ColumnsResolver recursively.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.frameColumnsInternal(crossinline filter: (FrameColumn<*>) -> Boolean): TransformableColumnSet<AnyFrame>

Returns a TransformableColumnSet containing the frame columns that satisfy the given filter.

Link copied to clipboard
internal fun <T> ColumnsResolver<T>.getAt(index: Int): SingleColumn<T>
Link copied to clipboard
internal fun <T> ColumnSet<T>.getAtOrNull(index: Int): SingleColumn<T>
Link copied to clipboard
internal fun ColumnSet<*>.getChildrenAt(index: Int): ColumnSet<*>
Link copied to clipboard
internal fun <A> ColumnSet<A>.onResolve(check: (List<ColumnWithPath<A>>) -> Unit): ColumnSet<A>
Link copied to clipboard
open override fun resolve(context: ColumnResolutionContext): List<ColumnWithPath<C>>

Resolves this ColumnsResolver as a List<ColumnWithPath<C>>. In many cases this function transforms a parent ColumnsResolver to reach the current ColumnsResolver result.

Link copied to clipboard
internal fun <C> ColumnsResolver<C>.resolve(df: DataFrame<*>, unresolvedColumnsPolicy: UnresolvedColumnsPolicy = UnresolvedColumnsPolicy.Fail): List<ColumnWithPath<C>>
Link copied to clipboard

Simplifies structure by removing columns that are already present in column groups in this.

Link copied to clipboard

Converts this ColumnsResolver to a SingleColumn. resolveSingle will return the single column of this if there is only one, else it will throw an exception: In case of an empty ColumnsResolver, a NoSuchElementException will be thrown. In case of more than one column, an IllegalArgumentException will be thrown. If the result is used as a ColumnSet, null will be converted to an empty list.

Link copied to clipboard
internal fun <C> ColumnsResolver<C>.singleInternal(condition: ColumnFilter<C> = { true }): TransformableSingleColumn<C>
Link copied to clipboard

Converts this ColumnsResolver to a SingleColumn. resolveSingle will return the single column of this if there is only one, else it will return null. If the result used as a ColumnSet, null will be converted to an empty list.

Link copied to clipboard
internal inline fun <A, B> ColumnsResolver<A>.transform(crossinline converter: (List<ColumnWithPath<A>>) -> List<ColumnWithPath<B>>): TransformableColumnSet<B>

Applies a transformation on this by converting its List<ColumnWithPath<A>] to List<ColumnWithPath<B>] using converter.

Link copied to clipboard

Applies a transformation on this by converting its List<ColumnWithPath<A>] to List<ColumnWithPath<B>] using converter, but also providing the ColumnResolutionContext to the converter.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.valueColumnsInternal(crossinline filter: (ValueColumn<*>) -> Boolean): TransformableColumnSet<*>

Returns a TransformableColumnSet containing the value columns that satisfy the given filter.