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

widebase.db.table.Record.scala Maven / Gradle / Ivy

The newest version!
package widebase.db.table

import widebase.db.column.TypedColumn

/** A label accessible record.
 *
 * @author myst3r10n
 */
case class Record(labels: TypedColumn[_], values: Array[Any]) {

  /** Select a value by its label.
   *
   * @param label where values are selected
   *
   * @return value by label
   */
  def apply(label: Any) = {

    val index = labels.indexOf(label)

    if(index == -1)
      throw new ValueNotFound

    values(labels.indexOf(label))

  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy