mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-22 08:37:14 +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>
|
val row: Row<T>
|
||||||
get() = mutRow
|
get() = mutRow
|
||||||
|
|
||||||
fun add(t: T) = mutRow.add(t)
|
fun column(t: T) = mutRow.add(t)
|
||||||
operator fun T.unaryPlus() = add(this)
|
operator fun T.unaryPlus() = column(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> row(block: RowBuilder<T>.() -> Unit): List<T> = RowBuilder<T>().also(block).row
|
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(elements: List<T>) = elements.forEach(::column)
|
||||||
fun <T> RowBuilder<T>.columns(vararg elements: T) = elements.forEach(::column)
|
fun <T> RowBuilder<T>.columns(vararg elements: T) = elements.forEach(::column)
|
||||||
|
Loading…
Reference in New Issue
Block a user