BaseColumn

interface BaseColumn<out T> : ColumnReference<T>

Column with type, name/path and values Base interface for all three kinds of columns: ValueColumn, ColumnGroup and FrameColumn. Column operations that doesn't clash by signature with DataFrame operations can be defined for BaseColumn

Type Parameters

T

type of values contained in column.

See also

Inheritors

Properties

Link copied to clipboard
internal val AnyBaseCol.isEmpty: Boolean
Link copied to clipboard
internal val ColumnReference<*>.name: String
Link copied to clipboard
internal val AnyBaseCol.size: Int
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
internal fun <T> BaseColumn<T>.addParent(parent: ColumnGroup<*>): DataColumn<T>
Link copied to clipboard
Link copied to clipboard
internal fun <T> BaseColumn<T>.addPath(): ColumnWithPath<T>
internal fun <T> BaseColumn<T>.addPath(path: ColumnPath): ColumnWithPath<T>
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

Returns a new ColumnSet that contains all columns from inside the receiver column group except those specified in the "other" ColumnsResolver.

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
@JvmName(name = "asColumnGroupDataRow")
fun <C> SingleColumn<DataRow<C>>.asColumnGroup(): SingleColumn<DataRow<C>>

Creates a ColumnAccessor<DataRow<C>> from this. This is especially useful when you want to use ColumnGroup functions in the ColumnsSelectionDsl but your column type is not recognized as a ColumnGroup. If you're not sure whether a column is recognized as ColumnGroup or not, you can always call asColumnGroup and it will return the same type if it is already a ColumnGroup.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "asNumbersAnyNullable")
fun SingleColumn<Any?>.asNumbers(): SingleColumn<Number?>
@JvmName(name = "asNumbersAny")
fun SingleColumn<Any>.asNumbers(): SingleColumn<Number>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal fun <T> BaseColumn<T>.checkEquals(other: Any?): Boolean
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> SingleColumn<DataRow<*>>.colsOf(noinline filter: (ColumnWithPath<C>) -> Boolean = { true }): ColumnSet<C>
fun <C> SingleColumn<DataRow<*>>.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
abstract operator fun contains(value: T): Boolean
Link copied to clipboard
abstract fun countDistinct(): Int
Link copied to clipboard
abstract fun defaultValue(): T?
Link copied to clipboard
abstract fun distinct(): BaseColumn<T>
Link copied to clipboard
operator fun ColumnReference<Int>.div(value: Int): ColumnReference<Int>

Returns a ColumnReference containing the results of dividing each element of this ColumnReference by value.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a ColumnGroup (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a FrameColumn (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a ValueColumn (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard
infix fun <C> ColumnReference<C>.eq(value: C): ColumnReference<Boolean>
Link copied to clipboard
@JvmName(name = "exceptInternalSingleColumn")
internal fun <C> SingleColumn<DataRow<C>>.exceptInternal(other: ColumnsResolver<*>): SingleColumn<DataRow<C>>

Returns a new SingleColumn> that has the same structure as the receiver, but excludes columns specified in the "other" ColumnsResolver.

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
abstract operator fun get(index: Int): T

Gets the row at given index.

abstract operator fun get(columnName: String): DataColumn<*>
open operator fun get(row: AnyRow): T

abstract operator fun get(indices: Iterable<Int>): BaseColumn<T>
open operator fun get(firstIndex: Int, vararg otherIndices: Int): BaseColumn<T>

Gets the rows at given indices.

abstract operator fun get(range: IntRange): BaseColumn<T>

Gets the rows at given range of indices.

Link copied to clipboard
internal fun <T> ColumnsResolver<T>.getAt(index: Int): SingleColumn<T>
Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): BaseColumn<T>
open fun getValue(row: AnyRow): T
Link copied to clipboard
open fun getValueOrNull(row: AnyRow): T?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun kind(): ColumnKind
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal inline fun <C, reified R> ColumnReference<C>.map(infer: Infer = Infer.Nulls, noinline transform: (C) -> R): ColumnReference<R>
Link copied to clipboard
internal fun BaseColumn<*>.maxWidth(): Int

Returns the max number of columns needed to display this column flattened

Link copied to clipboard

Returns a ColumnReference where each element is the result of subtracting value from the corresponding element of this ColumnReference.

Link copied to clipboard
abstract fun name(): String
Link copied to clipboard
infix fun <C> ColumnReference<C>.neq(value: C): ColumnReference<Boolean>
Link copied to clipboard
@JvmName(name = "notBooleanNullable")
operator fun ColumnReference<Boolean?>.not(): ColumnReference<Boolean?>

Returns a ColumnReference containing the inverse Boolean values of this ColumnReference. Each null value in the original ColumnReference is preserved.

Returns a ColumnReference containing the inverse Boolean values of this ColumnReference.

Link copied to clipboard
internal fun <A> SingleColumn<A>.onResolve(check: (ColumnWithPath<A>?) -> Unit): SingleColumn<A>

Helper function to perform runtime checks on a SingleColumn.

Link copied to clipboard
open fun path(): ColumnPath
Link copied to clipboard

Returns a ColumnReference of String values obtained by converting each element of this ColumnReference to a String and concatenating it with str.

operator fun ColumnReference<Int>.plus(value: Int): ColumnReference<Int>

Returns a ColumnReference where each element is the result of adding value to the corresponding element of this ColumnReference.

Link copied to clipboard
abstract override fun rename(newName: String): BaseColumn<T>
Link copied to clipboard
internal fun <C> SingleColumn<C>.renamedColumn(newName: String): SingleColumn<C>
Link copied to clipboard
Link copied to clipboard
open override fun resolve(context: ColumnResolutionContext): List<ColumnWithPath<T>>

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
Link copied to clipboard
open override fun resolveSingle(context: ColumnResolutionContext): ColumnWithPath<T>?
Link copied to clipboard
internal fun <C> SingleColumn<C>.resolveSingle(df: DataFrame<*>, unresolvedColumnsPolicy: UnresolvedColumnsPolicy = UnresolvedColumnsPolicy.Fail): ColumnWithPath<C>?
Link copied to clipboard
internal fun <C, R> SingleColumn<DataRow<C>>.selectInternal(selector: ColumnsSelector<C, R>): ColumnSet<R>
Link copied to clipboard
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
abstract fun size(): Int
Link copied to clipboard

Returns a ColumnReference containing the results of multiplying each element of this ColumnReference by value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun toList(): List<T>
Link copied to clipboard
abstract fun toSet(): Set<T>
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
internal fun <A, B> SingleColumn<A>.transformSingle(converter: (ColumnWithPath<A>) -> List<ColumnWithPath<B>>): ColumnSet<B>

Applies a transformation on this SingleColumn by converting its single ColumnWithPath<A> to List<ColumnWithPath<B>] using converter. Since converter allows you to return multiple columns, the result is turned into a ColumnSet<B>.

Link copied to clipboard

Applies a transformation on this SingleColumn by converting its single ColumnWithPath<A> to List<ColumnWithPath<B>] using converter but also providing the ColumnResolutionContext to the 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
abstract fun type(): KType
Link copied to clipboard

Returns a ColumnReference containing negatives of the corresponding elements of this ColumnReference.

Link copied to clipboard
internal fun AnyBaseCol.unbox(): AnyCol
Link copied to clipboard
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.

Link copied to clipboard
abstract fun values(): Iterable<T>
Link copied to clipboard
inline fun <reified T> ColumnReference<T>.withValues(values: Iterable<T>): ValueColumn<T>
inline fun <reified T> ColumnReference<T>.withValues(vararg values: T): ValueColumn<T>