|
case class TableHeader(titles: List[String]) { |
|
def |(title: String) = |
|
copy(titles = titles :+ title) |
|
def |[T1](row: DataRow1[T1]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1](row: DataRow1[T1]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2](row: DataRow2[T1,T2]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2](row: DataRow2[T1,T2]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3](row: DataRow3[T1,T2,T3]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3](row: DataRow3[T1,T2,T3]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4](row: DataRow4[T1,T2,T3,T4]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4](row: DataRow4[T1,T2,T3,T4]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5](row: DataRow5[T1,T2,T3,T4,T5]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5](row: DataRow5[T1,T2,T3,T4,T5]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5, T6](row: DataRow6[T1,T2,T3,T4,T5,T6]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5, T6](row: DataRow6[T1,T2,T3,T4,T5,T6]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5, T6, T7](row: DataRow7[T1,T2,T3,T4,T5,T6,T7]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5, T6, T7](row: DataRow7[T1,T2,T3,T4,T5,T6,T7]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5, T6, T7, T8](row: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5, T6, T7, T8](row: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5, T6, T7, T8, T9](row: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5, T6, T7, T8, T9](row: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) = |
|
new <notype>(titles, List(row), execute = true) |
|
def |[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](row: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) = |
|
new <notype>(titles, List(row)) |
|
def |>[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](row: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) = |
|
new <notype>(titles, List(row), execute = true) |
|
} |
|
case class Table1[T1](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1](row: Int): Table1 = |
|
Table1(titles, outer.rows :+ row, execute) |
|
def |[R](f: T1 => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: T1 => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: T1 => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table2[T1, T2](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2](row: Int): Table2 = |
|
Table2(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table3[T1, T2, T3](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3](row: Int): Table3 = |
|
Table3(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table4[T1, T2, T3, T4](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4](row: Int): Table4 = |
|
Table4(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table5[T1, T2, T3, T4, T5](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5](row: Int): Table5 = |
|
Table5(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table6[T1, T2, T3, T4, T5, T6](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6](row: Int): Table6 = |
|
Table6(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5, T6) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5, T6) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5, T6) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table7[T1, T2, T3, T4, T5, T6, T7](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7](row: Int): Table7 = |
|
Table7(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5, T6, T7) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5, T6, T7) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5, T6, T7) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table8[T1, T2, T3, T4, T5, T6, T7, T8](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8](row: Int): Table8 = |
|
Table8(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table9[T1, T2, T3, T4, T5, T6, T7, T8, T9](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8, S9 >: T9](row: Int): Table9 = |
|
Table9(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |
|
case class Table10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](titles: List[String], execute: Boolean = true) extends Table(titles, execute) { |
|
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8, S9 >: T9, S10 >: T10](row: Int): Table10 = |
|
Table10(titles, outer.rows :+ row, execute) |
|
def |[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R) = |
|
executeRow(f, execute) |
|
def |>[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R) = |
|
executeRow(f, true) |
|
def executeRow[R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R, exec: Boolean): DecoratedResult[DataTable] = { |
|
if (exec) collect(rows map apply()) |
|
else DecoratedResult(DataTable(titles, Seq()), Success("ok")) |
|
} |
|
} |