RowSetterIfc

An abstraction for getting information and setting data for a row within a tabular file. The access to the columns is 0-based. Why? Because most if not all of kotlin's data containers (arrays, lists, etc.) are 0-based. The first column has index 0, 2nd column has index 1, etc.

Inheritors

Functions

Link copied to clipboard
abstract fun setElement(colNum: Int, element: Any?)
Link copied to clipboard
abstract fun setElements(elements: Array<Any?>)
abstract fun setElements(elements: List<Any?>)
open fun setElements(data: TabularData)

The row is filled with the elements. Numeric elements are saved in numeric columns in the order presented. Non-numeric elements are all converted to strings and stored in the order presented. Numeric elements are of types {Double, Long, Integer, Boolean, Float, Short, Byte}. Any other type is converted to text via toString().

Link copied to clipboard
abstract fun setNumeric(data: DoubleArray): Int

Sets the numeric columns according to the data in the array. If the array has more elements than the number of columns, then the columns are filled with first elements of the array up to the number of columns. If the array has fewer elements than the number of columns, then only the first data.length columns are set.

open fun setNumeric(colNum: Int, value: Boolean)
abstract fun setNumeric(colNum: Int, value: Double)
abstract fun setNumeric(columnName: String, value: Double)
Link copied to clipboard
abstract fun setText(data: Array<String?>): Int

Sets the text columns according to the data in the array. If the array has more elements than the number of columns, then the columns are filled with first elements of the array up to the number of columns. If the array has less elements than the number of columns, then only the first data.length columns are set.

abstract fun setText(data: List<String?>): Int

Sets the text columns according to the data in the list. If the list has more elements than the number of columns, then the columns are filled with first elements of the list up to the number of columns. If the list has less elements than the number of columns, then only the first data.size() columns are set.

abstract fun setText(colNum: Int, value: String?)
abstract fun setText(columnName: String, value: String?)