fi.pelam.csv

cell

package cell

This package contains the low level data types used for representing a single cell in CSV data.

Source
package.scala
See also

The abstract base class for Cells.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. cell
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait AxisKey[T <: AxisKey[_]] extends Ordered[T]

    Base type for RowKey and ColKey.

    Base type for RowKey and ColKey. Provides index and ordering.

    Ordering is simply the natural order of the index values.

  2. abstract class Cell extends AnyRef

    Base class for cells used in this CSV library.

    Base class for cells used in this CSV library.

    The two main APIs of this library the table oriented and the stream oriented use subclasses of this class to represent the data.

    One important use for this class is in CsvReader. CsvReader outputs instances of StringCell which is a subclass of this class.

    See also

    See the documentation of cellKey member below for design rationale on having coordinates in each cell.

  3. final case class CellKey(rowIndex: Int, colIndex: Int) extends Ordered[CellKey] with Product with Serializable

    Coordinates of a Cell in a CSV "table".

    Coordinates of a Cell in a CSV "table".

    Basically a composition of RowKey and ColKey or alternatively just two zero based integers rowIndex and colIndex.

    Each Cell has a CellKey as a member.

    Cell coordinates

    Columns and rows are thought to start from top left corner.

    Typically in spreadsheet programs columns are numbered with an alphabetical scheme and the row number is a one based integer.

    Ordering

    CellKeys are ordered first in increasing row order and then in increasing column order.

    The object representations provide type safety and spread sheet style column and row numbering.

  4. final case class CellParsingError(msg: String) extends Product with Serializable

    Cell.Parser subtypes produce these errors when they can't parse the cell content string.

  5. final case class ColKey(index: Int) extends AxisKey[ColKey] with Product with Serializable

    Type for columns numbers used in parsed CSV data.

    Type for columns numbers used in parsed CSV data.

    This corresponds to Nth position separated by separator characters on each line in CSV text file.

    Most interesting functionality is the conversion of integer indices into alphabetical numbering used in spreadsheet programs.

    index

    zero based column number (column index).

  6. final case class DoubleCell(cellKey: CellKey, value: Double)(implicit formatter: DoubleCell.NumberFormatter = DoubleCell.defaultFormatter) extends Cell with Product with Serializable

    See documentation on IntegerCell.

    See documentation on IntegerCell. This is basically same, but with Double instead of Int.

  7. final case class IntegerCell(cellKey: CellKey, value: Int)(implicit formatter: IntegerCell.NumberFormatter = IntegerCell.defaultFormatter) extends Cell with NumberCell[Int] with Product with Serializable

    Basically this class is a sample implementation of a more specialised subtype of fi.pelam.csv.cell.Cell.

    Basically this class is a sample implementation of a more specialised subtype of fi.pelam.csv.cell.Cell.

    It is expected that any nontrivial client will want to specify its own subtypes of fi.pelam.csv.cell.Cell.

    This class is quite simple, but the companion object is more interesting as it provides Cell.Parser functions which produce IntegerCell instances (or errors if parsing fails) from String data.

    cellKey

    the location of this cell in a CSV table.

    value

    is the integer stored in CSV.

    formatter

    A function used to convert the integer held by this cell into a String to be stored in CSV text data.

  8. trait NumberCell[T <: AnyVal] extends Cell

  9. trait PrimitiveCellObject[T <: AnyVal] extends AnyRef

  10. case class RowKey(index: Int) extends AxisKey[RowKey] with Product with Serializable

    Type for row numbers used in parsed CSV data.

    Type for row numbers used in parsed CSV data.

    This corresponds to zero based row number in CSV text file.

    index

    zero based row number (row index).

  11. final case class StringCell(cellKey: CellKey, serializedString: String) extends Cell with Product with Serializable

    The most basic subtype of Cell.

    The most basic subtype of Cell.

    This cell type simply contains the raw data from a position in a CSV text file.

    cellKey

    the location of the cell in the CSV file.

    serializedString

    simply the string from the CSV file.

    Note

    However note that any possible quoting is removed and no separator or CSV line ending characters are included.

    The lower level CSV parser API CsvReader produces these.

Value Members

  1. object Cell

  2. object CellKey extends Serializable

  3. object CellParserUtil

  4. object ColKey extends Serializable

  5. object DoubleCell extends PrimitiveCellObject[Double] with Serializable

    See documentation on IntegerCell.

    See documentation on IntegerCell. This is basically same, but with Double instead of Int.

  6. object IntegerCell extends PrimitiveCellObject[Int] with Serializable

    The IntegerCell class it self is quite simple, but this companion object is more interesting as provides Cell.Parser functions.

    The IntegerCell class it self is quite simple, but this companion object is more interesting as provides Cell.Parser functions. These functions in turn produce IntegerCell instances (or errors if parsing fails) from String data.

    Cell.Parser functions can be used used to upgrade cells in fi.pelam.csv.table.TableReader in an easy way by using them in a map passed to fi.pelam.csv.table.TableReaderConfig.makeCellUpgrader. The map specifies which cells should be interpreted as containing integers.

  7. object RowKey extends Serializable

  8. object StringCell extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped