mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-20 07:13:50 +00:00
remove add and put column method in matrix row builder
This commit is contained in:
parent
d41c3c2de4
commit
b120fbd2b1
@ -5,11 +5,10 @@ class RowBuilder<T> {
|
||||
val row: Row<T>
|
||||
get() = mutRow
|
||||
|
||||
fun add(t: T) = mutRow.add(t)
|
||||
operator fun T.unaryPlus() = add(this)
|
||||
fun column(t: T) = mutRow.add(t)
|
||||
operator fun T.unaryPlus() = column(this)
|
||||
}
|
||||
|
||||
fun <T> row(block: RowBuilder<T>.() -> Unit): List<T> = RowBuilder<T>().also(block).row
|
||||
fun <T> RowBuilder<T>.column(element: T) = +element
|
||||
fun <T> RowBuilder<T>.columns(elements: List<T>) = elements.forEach(::column)
|
||||
fun <T> RowBuilder<T>.columns(vararg elements: T) = elements.forEach(::column)
|
||||
|
Loading…
Reference in New Issue
Block a user