All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.inmo.micro_utils.matrix.RowBuilder.kt Maven / Gradle / Ivy

There is a newer version: 0.22.2
Show newest version
package dev.inmo.micro_utils.matrix

open class RowBuilder {
    private val mutRow: MutableList = ArrayList()
    val row: Row
        get() = mutRow

    fun add(t: T) = mutRow.add(t)
    operator fun T.unaryPlus() = column(this)
    fun column(t: T) = mutRow.add(t)
}

fun  row(block: RowBuilder.() -> Unit): List = RowBuilder().also(block).row
fun  RowBuilder.columns(elements: List) = elements.forEach(::column)
fun  RowBuilder.columns(vararg elements: T) = elements.forEach(::column)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy