Row

An abstraction 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.

Constructors

Link copied to clipboard
constructor(tabularFile: TabularFile)

Properties

Link copied to clipboard
open override val bytes: Int
Link copied to clipboard
open override val columnNames: List<String>
Link copied to clipboard
open override val columnTypes: Map<String, DataType>
Link copied to clipboard
open override val dataTypes: List<DataType>
Link copied to clipboard
open override val elements: List<Any?>
Link copied to clipboard
open override val isAllNumeric: Boolean
Link copied to clipboard
open override val isAllText: Boolean
Link copied to clipboard
open override val numberColumns: Int
Link copied to clipboard
open override val numeric: DoubleArray
Link copied to clipboard
open override val numNumericColumns: Int
Link copied to clipboard
open override val numTextColumns: Int
Link copied to clipboard
Link copied to clipboard
open override val text: Array<String?>

Functions

Link copied to clipboard
open override fun asStringArray(): Array<String?>
Link copied to clipboard
open override fun getColumn(name: String): Int
Link copied to clipboard
open override fun getColumnName(col: Int): String
Link copied to clipboard
open override fun getDataType(colNum: Int): DataType
Link copied to clipboard
open override fun getElement(colNum: Int): Any?
Link copied to clipboard
open override fun getNumeric(colNum: Int): Double
open override fun getNumeric(columnName: String): Double
Link copied to clipboard
open override fun getText(colNum: Int): String?
open override fun getText(columnName: String): String?
Link copied to clipboard
open override fun getType(col: Int): DataType
Link copied to clipboard
open override fun isNumeric(i: Int): Boolean
Link copied to clipboard
open override fun isText(i: Int): Boolean
Link copied to clipboard
open override fun setElement(colNum: Int, element: Any?)
Link copied to clipboard
open override fun setElements(elements: Array<Any?>)
open override 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
open override 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 override fun setNumeric(colNum: Int, value: Double)
open override fun setNumeric(columnName: String, value: Double)
open fun setNumeric(colNum: Int, value: Boolean)
Link copied to clipboard
open override 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.

open override 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.

open override fun setText(colNum: Int, value: String?)
open override fun setText(columnName: String, value: String?)
Link copied to clipboard
open override fun toCSV(): String
Link copied to clipboard
open override fun toString(): String