Header

com.phasmidsoftware.tableparser.core.table.Header
See theHeader companion object
case class Header(xs: Seq[String], xss: Seq[Seq[String]])

Case class to represent a header.

A Header is normally read from the first row(s) of a file (see TableParser.headerRowsToRead). Otherwise, a fixed Header can be given to a TableParser (e.g. via setHeader), made in one of these ways:

  • Header.create("a", "b", "c"): the given column names;
  • HeaderX: the names of the fields of the case class X;
  • Header(letters = true, n): n columns named as in a spreadsheet (A B ... Z AA AB ...), or by number (1 2 3 ...);
  • Header(wss): from several rows, the first of which gives the column names.

Value parameters

xs

the sequence of column names.

xss

a sequence of sequence of String representing any additional header lines.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def ++(other: Header): Header

Concatenate this Header with other.

Concatenate this Header with other.

The additional header lines are joined pairwise (a missing line counts as empty).

Value parameters

other

the other Header.

Attributes

Returns

a Header made up of these columns and those of other, in that order.

def getIndex(w: String): Try[Int]

Get the index of w in this Header. A column whose name is exactly w is preferred; only if there is none is case ignored. So, if two columns differ only in case, the exact one is found, and a table which TableParser writes (with exact column names) is read back exactly.

Get the index of w in this Header. A column whose name is exactly w is preferred; only if there is none is case ignored. So, if two columns differ only in case, the exact one is found, and a table which TableParser writes (with exact column names) is read back exactly.

Value parameters

w

the String to find, a column name.

Attributes

Returns

the index wrapped in Try.

def size: Int

Get the number of columns.

Get the number of columns.

Attributes

Returns

the size of the header sequence.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product