org.scalatest.prop.Tables

Table

object Table extends AnyRef

Object containing one apply factory method for each TableFor<n> class.

For example, you could create a table of 5 rows and 2 colums like this:

import org.scalatest.prop.Tables._

val examples = Table( ("a", "b"), ( 1, 2), ( 2, 4), ( 4, 8), ( 8, 16), ( 16, 32) )

Because you supplied 2 members in each tuple, the type you'll get back will be a TableFor2. If you wanted a table with just one column you could write this:

val moreExamples =
  Table(
    "powerOfTwo",
         1,
         2,
         4,
         8,
         16
  )

Or if you wanted a table with 10 columns and 10 rows, you could do this:

val multiplicationTable =
  Table(
    ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j"),
    (  1,   2,   3,   4,   5,   6,   7,   8,   9,  10),
    (  2,   4,   6,   8,  10,  12,  14,  16,  18,  20),
    (  3,   6,   9,  12,  15,  18,  21,  24,  27,  30),
    (  4,   8,  12,  16,  20,  24,  28,  32,  36,  40),
    (  5,  10,  15,  20,  25,  30,  35,  40,  45,  50),
    (  6,  12,  18,  24,  30,  36,  42,  48,  54,  60),
    (  7,  14,  21,  28,  35,  42,  49,  56,  63,  70),
    (  8,  16,  24,  32,  40,  48,  56,  64,  72,  80),
    (  9,  18,  27,  36,  45,  54,  63,  72,  81,  90),
    ( 10,  20,  30,  40,  50,  60,  70,  80,  90, 100)
  )

The type of multiplicationTable would be TableFor10. You can pass the resulting tables to a forAll method (defined in trait PropertyChecks), to perform a property check with the data in the table. Or, because tables are sequences of tuples, you can treat them as a Seq.

linear super types: AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Table
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All
Impl.
  1. Concrete
  2. Abstract

Value Members

  1. def != (arg0: AnyRef) : Boolean

    attributes: final
    definition classes: AnyRef
  2. def != (arg0: Any) : Boolean

    o != arg0 is the same as !(o == (arg0)).

    o != arg0 is the same as !(o == (arg0)).

    arg0

    the object to compare against this object for dis-equality.

    returns

    false if the receiver object is equivalent to the argument; true otherwise.

    attributes: final
    definition classes: Any
  3. def ## () : Int

    attributes: final
    definition classes: AnyRef → Any
  4. def $asInstanceOf [T0] () : T0

    attributes: final
    definition classes: AnyRef
  5. def $isInstanceOf [T0] () : Boolean

    attributes: final
    definition classes: AnyRef
  6. def == (arg0: AnyRef) : Boolean

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: AnyRef
  7. def == (arg0: Any) : Boolean

    o == arg0 is the same as o.equals(arg0).

    o == arg0 is the same as o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: Any
  8. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)*) : TableFor22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]

    Factory method for creating a new TableFor22.

    Factory method for creating a new TableFor22.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple22s containing the data of this table

  9. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)*) : TableFor21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

    Factory method for creating a new TableFor21.

    Factory method for creating a new TableFor21.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple21s containing the data of this table

  10. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)*) : TableFor20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]

    Factory method for creating a new TableFor20.

    Factory method for creating a new TableFor20.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple20s containing the data of this table

  11. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)*) : TableFor19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]

    Factory method for creating a new TableFor19.

    Factory method for creating a new TableFor19.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple19s containing the data of this table

  12. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)*) : TableFor18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]

    Factory method for creating a new TableFor18.

    Factory method for creating a new TableFor18.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple18s containing the data of this table

  13. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)*) : TableFor17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]

    Factory method for creating a new TableFor17.

    Factory method for creating a new TableFor17.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple17s containing the data of this table

  14. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)*) : TableFor16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]

    Factory method for creating a new TableFor16.

    Factory method for creating a new TableFor16.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple16s containing the data of this table

  15. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)*) : TableFor15[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]

    Factory method for creating a new TableFor15.

    Factory method for creating a new TableFor15.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple15s containing the data of this table

  16. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M, N] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N)*) : TableFor14[A, B, C, D, E, F, G, H, I, J, K, L, M, N]

    Factory method for creating a new TableFor14.

    Factory method for creating a new TableFor14.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple14s containing the data of this table

  17. def apply [A, B, C, D, E, F, G, H, I, J, K, L, M] (heading: (String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M)*) : TableFor13[A, B, C, D, E, F, G, H, I, J, K, L, M]

    Factory method for creating a new TableFor13.

    Factory method for creating a new TableFor13.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple13s containing the data of this table

  18. def apply [A, B, C, D, E, F, G, H, I, J, K, L] (heading: (String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L)*) : TableFor12[A, B, C, D, E, F, G, H, I, J, K, L]

    Factory method for creating a new TableFor12.

    Factory method for creating a new TableFor12.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple12s containing the data of this table

  19. def apply [A, B, C, D, E, F, G, H, I, J, K] (heading: (String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K)*) : TableFor11[A, B, C, D, E, F, G, H, I, J, K]

    Factory method for creating a new TableFor11.

    Factory method for creating a new TableFor11.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple11s containing the data of this table

  20. def apply [A, B, C, D, E, F, G, H, I, J] (heading: (String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J)*) : TableFor10[A, B, C, D, E, F, G, H, I, J]

    Factory method for creating a new TableFor10.

    Factory method for creating a new TableFor10.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple10s containing the data of this table

  21. def apply [A, B, C, D, E, F, G, H, I] (heading: (String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I)*) : TableFor9[A, B, C, D, E, F, G, H, I]

    Factory method for creating a new TableFor9.

    Factory method for creating a new TableFor9.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple9s containing the data of this table

  22. def apply [A, B, C, D, E, F, G, H] (heading: (String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H)*) : TableFor8[A, B, C, D, E, F, G, H]

    Factory method for creating a new TableFor8.

    Factory method for creating a new TableFor8.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple8s containing the data of this table

  23. def apply [A, B, C, D, E, F, G] (heading: (String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G)*) : TableFor7[A, B, C, D, E, F, G]

    Factory method for creating a new TableFor7.

    Factory method for creating a new TableFor7.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple7s containing the data of this table

  24. def apply [A, B, C, D, E, F] (heading: (String, String, String, String, String, String), rows: (A, B, C, D, E, F)*) : TableFor6[A, B, C, D, E, F]

    Factory method for creating a new TableFor6.

    Factory method for creating a new TableFor6.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple6s containing the data of this table

  25. def apply [A, B, C, D, E] (heading: (String, String, String, String, String), rows: (A, B, C, D, E)*) : TableFor5[A, B, C, D, E]

    Factory method for creating a new TableFor5.

    Factory method for creating a new TableFor5.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple5s containing the data of this table

  26. def apply [A, B, C, D] (heading: (String, String, String, String), rows: (A, B, C, D)*) : TableFor4[A, B, C, D]

    Factory method for creating a new TableFor4.

    Factory method for creating a new TableFor4.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple4s containing the data of this table

  27. def apply [A, B, C] (heading: (String, String, String), rows: (A, B, C)*) : TableFor3[A, B, C]

    Factory method for creating a new TableFor3.

    Factory method for creating a new TableFor3.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple3s containing the data of this table

  28. def apply [A, B] (heading: (String, String), rows: (A, B)*) : TableFor2[A, B]

    Factory method for creating a new TableFor2.

    Factory method for creating a new TableFor2.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple2s containing the data of this table

  29. def apply [A] (heading: String, rows: A*) : TableFor1[A]

    Factory method for creating a new TableFor1.

    Factory method for creating a new TableFor1.

    heading

    a tuple containing string names of the columns in this table

    rows

    a variable length parameter list of Tuple1s containing the data of this table

  30. def asInstanceOf [T0] : T0

    This method is used to cast the receiver object to be of type T0.

    This method is used to cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expressionList(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    the receiver object.

    attributes: final
    definition classes: Any
  31. def clone () : AnyRef

    This method creates and returns a copy of the receiver object.

    This method creates and returns a copy of the receiver object.

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object.

    attributes: protected
    definition classes: AnyRef
  32. def eq (arg0: AnyRef) : Boolean

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    The eq method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on non-null instances of AnyRef: * It is reflexive: for any non-null instance x of type AnyRef, x.eq(x) returns true. * It is symmetric: for any non-null instances x and y of type AnyRef, x.eq(y) returns true if and only if y.eq(x) returns true. * It is transitive: for any non-null instances x, y, and z of type AnyRef if x.eq(y) returns true and y.eq(z) returns true, then x.eq(z) returns true.

    Additionally, the eq method has three other properties. * It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false. * For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false. * null.eq(null) returns true.

    When overriding the equals or hashCode methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2), they should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

    arg0

    the object to compare against this object for reference equality.

    returns

    true if the argument is a reference to the receiver object; false otherwise.

    attributes: final
    definition classes: AnyRef
  33. def equals (arg0: Any) : Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]: * It is reflexive: for any instance x of type Any, x.equals(x) should return true. * It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true. * It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same scala.Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef → Any
  34. def finalize () : Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    The details of when and if the finalize method are invoked, as well as the interaction between finalizeand non-local returns and exceptions, are all platform dependent.

    attributes: protected
    definition classes: AnyRef
  35. def getClass () : java.lang.Class[_]

    Returns a representation that corresponds to the dynamic class of the receiver object.

    Returns a representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

    a representation that corresponds to the dynamic class of the receiver object.

    attributes: final
    definition classes: AnyRef
  36. def hashCode () : Int

    Returns a hash code value for the object.

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    returns

    the hash code value for the object.

    definition classes: AnyRef → Any
  37. def isInstanceOf [T0] : Boolean

    This method is used to test whether the dynamic type of the receiver object is T0.

    This method is used to test whether the dynamic type of the receiver object is T0.

    Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    attributes: final
    definition classes: Any
  38. def ne (arg0: AnyRef) : Boolean

    o.ne(arg0) is the same as !(o.eq(arg0)).

    o.ne(arg0) is the same as !(o.eq(arg0)).

    arg0

    the object to compare against this object for reference dis-equality.

    returns

    false if the argument is not a reference to the receiver object; true otherwise.

    attributes: final
    definition classes: AnyRef
  39. def notify () : Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  40. def notifyAll () : Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  41. def synchronized [T0] (arg0: T0) : T0

    attributes: final
    definition classes: AnyRef
  42. def toString () : String

    Returns a string representation of the object.

    Returns a string representation of the object.

    The default representation is platform dependent.

    returns

    a string representation of the object.

    definition classes: AnyRef → Any
  43. def wait () : Unit

    attributes: final
    definition classes: AnyRef
  44. def wait (arg0: Long, arg1: Int) : Unit

    attributes: final
    definition classes: AnyRef
  45. def wait (arg0: Long) : Unit

    attributes: final
    definition classes: AnyRef

Inherited from AnyRef

Inherited from Any