case class HeadedStringTableParser[X](maybeFixedHeader: Option[Header] = None, forgiving: Boolean = false, headerRowsToRead: Int = 1)(implicit evidence$1: CellParser[X], evidence$2: ClassTag[X]) extends StringTableParser[Table[X]] with CopyableTableParser[X, String, Table[X]] with Product with Serializable
Case class to define a StringTableParser that assumes a header to be found in the input file. This class attempts to provide as much built-in functionality as possible.
This class assumes that the names of the columns are in the first line. This class implements builder with a HeadedTable object. This class uses StandardRowParser of its rowParser.
- X
the underlying row type which must provide evidence of a CellParser and ClassTag.
- maybeFixedHeader
None => requires that the data source has a header row. Some(h) => specifies that the header is to be taken from h. NOTE: that the simplest is to specify the header directly from the type X:
- See also
HeadedStringTableParser#create
- Alphabetic
- By Inheritance
- HeadedStringTableParser
- Serializable
- Product
- Equals
- CopyableTableParser
- StringTableParser
- AbstractTableParser
- TableParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new HeadedStringTableParser(maybeFixedHeader: Option[Header] = None, forgiving: Boolean = false, headerRowsToRead: Int = 1)(implicit arg0: CellParser[X], arg1: ClassTag[X])
- maybeFixedHeader
None => requires that the data source has a header row. Some(h) => specifies that the header is to be taken from h. NOTE: that the simplest is to specify the header directly from the type X:
Type Members
- type Input = String
The input type.
The input type.
- Definition Classes
- StringTableParser → TableParser
- type Row = X
The row type.
The row type.
- Definition Classes
- HeadedStringTableParser → TableParser
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def builder(rows: Iterable[X], header: Header): Table[Row]
Default method to create a new table.
Default method to create a new table. It does this by invoking either builderWithHeader or builderWithoutHeader, as appropriate.
CONSIDER changing Iterable back to Iterator as it was at V1.0.13.
- rows
the rows which will make up the table.
- header
the Header, derived either from the program or the data.
- returns
an instance of Table.
- Attributes
- protected
- Definition Classes
- HeadedStringTableParser → TableParser
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def doParseRows[T](ts: Iterator[T], header: Header, f: ((T, Int)) => (Header) => Try[Row])(implicit arg0: Joinable[T]): Try[Table[X]]
Common code for parsing rows.
Common code for parsing rows.
CONSIDER convert T to Input
CONSIDER switch order of f
- T
the parametric type of the resulting Table. T corresponds to Input in the calling method, i.e. a Row. Must be Joinable.
- ts
a sequence of Ts.
- header
the Header.
- f
a curried function which transforms a (T, Int) into a function which is of type Header => Try[Row].
- returns
a Try of Table
- Attributes
- protected
- Definition Classes
- AbstractTableParser
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def failureHandler(ry: Try[Row]): Unit
- Attributes
- protected
- Definition Classes
- AbstractTableParser
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val forgiving: Boolean
Method to determine how errors are handled.
Method to determine how errors are handled.
- returns
true if individual errors are logged but do not cause parsing to fail.
- Definition Classes
- HeadedStringTableParser → TableParser
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val headerRowsToRead: Int
This indicates the number of header rows which must be read from the input.
This indicates the number of header rows which must be read from the input. If maybeFixedHeader exists, then this number should be zero.
- Definition Classes
- HeadedStringTableParser → TableParser
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maybeFixedHeader: Option[Header]
This variable determines if there is a programmed, i.e.
This variable determines if there is a programmed, i.e. fixed, header for the parser. If its value is None, it signifies that we must look to the first line of data for an appropriate header.
- Definition Classes
- HeadedStringTableParser → TableParser
- val multiline: Boolean
Value to determine whether it is acceptable to have a quoted string span more than one line.
Value to determine whether it is acceptable to have a quoted string span more than one line.
- returns
true if quoted strings may span more than one line.
- Attributes
- protected
- Definition Classes
- TableParser
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parse(xs: Iterator[Input], n: Int = 0): Try[Table[X]]
Method to parse a table based on a sequence of Inputs.
Method to parse a table based on a sequence of Inputs.
- xs
the sequence of Inputs, one for each row
- n
the number of lines that should be used as a Header. If n == 0 == maybeFixedHeader.empty then there is a logic error.
- returns
a Try[Table]
- Definition Classes
- AbstractTableParser → TableParser
- def parseRows(xs: Iterator[String], header: Header): Try[Table[X]]
Abstract method to parse a sequence of Inputs, with a given header.
Abstract method to parse a sequence of Inputs, with a given header.
- xs
the sequence of Inputs, one for each row
- header
the header to be used.
- returns
a Try[Table]
- Definition Classes
- StringTableParser → AbstractTableParser
- val predicate: (Try[Row]) => Boolean
Function to determine whether or not a row should be included in the table.
Function to determine whether or not a row should be included in the table. Typically used for random sampling.
- Attributes
- protected
- Definition Classes
- TableParser
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val rowParser: RowParser[X, String]
Method to define a row parser.
Method to define a row parser.
- returns
a RowParser[Row, Input].
- Attributes
- protected
- Definition Classes
- HeadedStringTableParser → TableParser
- def setForgiving(b: Boolean): HeadedStringTableParser[X]
- Definition Classes
- HeadedStringTableParser → CopyableTableParser
- def setHeader(header: Header): HeadedStringTableParser[X]
- Definition Classes
- HeadedStringTableParser → CopyableTableParser
- def setMultiline(b: Boolean): HeadedStringTableParser[X]
- Definition Classes
- HeadedStringTableParser → CopyableTableParser
- def setPredicate(p: (Try[X]) => Boolean): HeadedStringTableParser[X]
- Definition Classes
- HeadedStringTableParser → CopyableTableParser
- def setRowParser(rp: RowParser[X, Input]): TableParser[Table[X]]
- Definition Classes
- HeadedStringTableParser → CopyableTableParser
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()