org.scalacheck

Gen

object Gen

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

Type Members

  1. trait Choose[T] extends AnyRef

    A wrapper type for range types

  2. trait Parameters extends AnyRef

    Generator parameters, used by org.scalacheck.Gen.apply

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Choose

    Provides implicit org.scalacheck.Gen.Choose instances

  7. object Parameters

    Provides methods for creating org.scalacheck.Gen.Parameters values

  8. def alphaChar: Gen[Char]

    Generates an alpha character

  9. def alphaLowerChar: Gen[Char]

    Generates a lower-case alpha character

  10. def alphaNumChar: Gen[Char]

    Generates an alphanumerical character

  11. def alphaStr: Gen[String]

    Generates a string of alpha characters

  12. def alphaUpperChar: Gen[Char]

    Generates an upper-case alpha character

  13. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  14. def buildableOf[C, T](g: Gen[T])(implicit evb: Buildable[T, C], evt: (C) ⇒ Traversable[T]): Gen[C]

    Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.

    Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance. The elements in the container will be generated by the given generator. The size of the container is bounded by the size parameter used when generating values.

  15. def buildableOfN[C, T](n: Int, g: Gen[T])(implicit evb: Buildable[T, C], evt: (C) ⇒ Traversable[T]): Gen[C]

    Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.

    Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance. The elements in the container will be generated by the given generator. The size of the generated container is limited by n. Depending on what kind of container that is generated, the resulting container may contain fewer elements than n, but not more. If the given generator fails generating a value, the complete container generator will also fail.

  16. def choose[T](min: T, max: T)(implicit c: Choose[T]): Gen[T]

    A generator that generates a random value in the given (inclusive) range.

    A generator that generates a random value in the given (inclusive) range. If the range is invalid, the generator will not generate any value.

  17. def chooseNum[T](minT: T, maxT: T, specials: T*)(implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates numbers within the given inclusive range, with extra weight on zero, +/- unity, both extremities, and any special numbers provided.

    Generates numbers within the given inclusive range, with extra weight on zero, +/- unity, both extremities, and any special numbers provided. The special numbers must lie within the given range, otherwise they won't be included.

  18. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. implicit def const[T](x: T): Gen[T]

    A generator that always generates the given value

  20. def containerOf[C[_], T](g: Gen[T])(implicit evb: Buildable[T, C[T]], evt: (C[T]) ⇒ Traversable[T]): Gen[C[T]]

    A convenience method for calling buildableOf[C[T],T](g).

  21. def containerOfN[C[_], T](n: Int, g: Gen[T])(implicit evb: Buildable[T, C[T]], evt: (C[T]) ⇒ Traversable[T]): Gen[C[T]]

    A convenience method for calling buildableOfN[C[T],T](n,g).

  22. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  24. def fail[T]: Gen[T]

    A generator that never generates a value

  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. implicit def freqTuple[T](t: (Int, T)): (Int, Gen[T])

    Implicit convenience method for using the frequency method like this:

    Implicit convenience method for using the frequency method like this:

    frequency((1, "foo"), (3, "bar"))
  27. def frequency[T](gs: (Int, Gen[T])*): Gen[T]

    Chooses one of the given generators with a weighted random distribution

  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. def identifier: Gen[String]

    Generates a string that starts with a lower-case alpha character, and only contains alphanumerical characters

  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. def listOf[T](g: ⇒ Gen[T]): Gen[List[T]]

    Generates a list of random length.

    Generates a list of random length. The maximum length depends on the size parameter. This method is equal to calling containerOf[List,T](g).

  33. def listOfN[T](n: Int, g: Gen[T]): Gen[List[T]]

    Generates a list of the given length.

    Generates a list of the given length. This method is equal to calling containerOfN[List,T](n,g).

  34. def lzy[T](g: ⇒ Gen[T]): Gen[T]

    Wraps a generator lazily.

    Wraps a generator lazily. The given parameter is only evaluated once, and not until the wrapper generator is evaluated.

  35. def mapOf[T, U](g: ⇒ Gen[(T, U)]): Gen[Map[T, U]]

    Generates a map of random length.

    Generates a map of random length. The maximum length depends on the size parameter. This method is equal to calling containerOf[Map,T,U](g).

  36. def mapOfN[T, U](n: Int, g: Gen[(T, U)]): Gen[Map[T, U]]

    Generates a map of with at least the given number of elements.

    Generates a map of with at least the given number of elements. This method is equal to calling containerOfN[Map,T,U](n,g).

  37. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. def negNum[T](implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates negative numbers of uniform distribution, with an lower bound of the negated generation size parameter.

  39. def nonEmptyBuildableOf[C, T](g: Gen[T])(implicit evb: Buildable[T, C], evt: (C) ⇒ Traversable[T]): Gen[C]

    Generates a non-empty container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.

    Generates a non-empty container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance. The elements in the container will be generated by the given generator. The size of the container is bounded by the size parameter used when generating values.

  40. def nonEmptyContainerOf[C[_], T](g: Gen[T])(implicit evb: Buildable[T, C[T]], evt: (C[T]) ⇒ Traversable[T]): Gen[C[T]]

    A convenience method for calling nonEmptyBuildableOf[C[T],T](g).

  41. def nonEmptyListOf[T](g: ⇒ Gen[T]): Gen[List[T]]

    Generates a non-empty list of random length.

    Generates a non-empty list of random length. The maximum length depends on the size parameter. This method is equal to calling nonEmptyContainerOf[List,T](g).

  42. def nonEmptyMap[T, U](g: ⇒ Gen[(T, U)]): Gen[Map[T, U]]

    Generates a non-empty map of random length.

    Generates a non-empty map of random length. The maximum length depends on the size parameter. This method is equal to calling nonEmptyContainerOf[Map,T,U](g).

  43. final def notify(): Unit

    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  45. def numChar: Gen[Char]

    Generates a numerical character

  46. def numStr: Gen[String]

    Generates a string of digits

  47. def oneOf[T](g0: Gen[T], g1: Gen[T], gn: Gen[T]*): Gen[T]

    Picks a random generator from a list

  48. def oneOf[T](t0: T, t1: T, tn: T*): Gen[T]

    Picks a random value from a list

  49. def oneOf[T](xs: Seq[T]): Gen[T]

    Picks a random value from a list

  50. def option[T](g: Gen[T]): Gen[Option[T]]

    Makes a generator result optional.

    Makes a generator result optional. Either Some(T) or None will be provided.

  51. def parameterized[T](f: (Parameters) ⇒ Gen[T]): Gen[T]

    Creates a generator that can access its generation parameters

  52. def pick[T](n: Int, g1: Gen[T], g2: Gen[T], gn: Gen[T]*): Gen[Seq[T]]

    A generator that picks a given number of elements from a list, randomly

  53. def pick[T](n: Int, l: Iterable[T]): Gen[Seq[T]]

    A generator that picks a given number of elements from a list, randomly

  54. def posNum[T](implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates positive numbers of uniform distribution, with an upper bound of the generation size parameter.

  55. def resize[T](s: Int, g: Gen[T]): Gen[T]

    Creates a resized version of a generator

  56. def resultOf[T1, T2, T3, T4, T5, T6, T7, T8, T9, R](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8], a9: Arbitrary[T9]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  57. def resultOf[T1, T2, T3, T4, T5, T6, T7, T8, R](f: (T1, T2, T3, T4, T5, T6, T7, T8) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  58. def resultOf[T1, T2, T3, T4, T5, T6, T7, R](f: (T1, T2, T3, T4, T5, T6, T7) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  59. def resultOf[T1, T2, T3, T4, T5, T6, R](f: (T1, T2, T3, T4, T5, T6) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  60. def resultOf[T1, T2, T3, T4, T5, R](f: (T1, T2, T3, T4, T5) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  61. def resultOf[T1, T2, T3, T4, R](f: (T1, T2, T3, T4) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  62. def resultOf[T1, T2, T3, R](f: (T1, T2, T3) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  63. def resultOf[T1, T2, R](f: (T1, T2) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  64. def resultOf[T, R](f: (T) ⇒ R)(implicit a: Arbitrary[T]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  65. def sequence[C, T](gs: Traversable[Gen[T]])(implicit b: Buildable[T, C]): Gen[C]

    Sequences generators.

    Sequences generators. If any of the given generators fails, the resulting generator will also fail.

  66. lazy val size: Gen[Int]

    A generator that returns the current generation size

  67. def sized[T](f: (Int) ⇒ Gen[T]): Gen[T]

    Creates a generator that can access its generation size

  68. def someOf[T](g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[Seq[T]]

    A generator that picks a random number of elements from a list

  69. def someOf[T](l: Iterable[T]): Gen[Seq[T]]

    A generator that picks a random number of elements from a list

  70. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  71. def toString(): String

    Definition Classes
    AnyRef → Any
  72. lazy val uuid: Gen[UUID]

    Generates a version 4 (random) UUID.

  73. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. def wrap[T](g: ⇒ Gen[T]): Gen[T]

    Wraps a generator for later evaluation.

    Wraps a generator for later evaluation. The given parameter is evaluated each time the wrapper generator is evaluated.

  77. def zip[T1, T2, T3, T4, T5, T6, T7, T8, T9](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4], g5: Gen[T5], g6: Gen[T6], g7: Gen[T7], g8: Gen[T8], g9: Gen[T9]): Gen[(T1, T2, T3, T4, T5, T6, T7, T8, T9)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  78. def zip[T1, T2, T3, T4, T5, T6, T7, T8](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4], g5: Gen[T5], g6: Gen[T6], g7: Gen[T7], g8: Gen[T8]): Gen[(T1, T2, T3, T4, T5, T6, T7, T8)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  79. def zip[T1, T2, T3, T4, T5, T6, T7](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4], g5: Gen[T5], g6: Gen[T6], g7: Gen[T7]): Gen[(T1, T2, T3, T4, T5, T6, T7)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  80. def zip[T1, T2, T3, T4, T5, T6](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4], g5: Gen[T5], g6: Gen[T6]): Gen[(T1, T2, T3, T4, T5, T6)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  81. def zip[T1, T2, T3, T4, T5](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4], g5: Gen[T5]): Gen[(T1, T2, T3, T4, T5)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  82. def zip[T1, T2, T3, T4](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3], g4: Gen[T4]): Gen[(T1, T2, T3, T4)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  83. def zip[T1, T2, T3](g1: Gen[T1], g2: Gen[T2], g3: Gen[T3]): Gen[(T1, T2, T3)]

    Combines the given generators into one generator that produces a tuple of their generated values.

  84. def zip[T1, T2](g1: Gen[T1], g2: Gen[T2]): Gen[(T1, T2)]

    Combines the given generators into one generator that produces a tuple of their generated values.

Inherited from AnyRef

Inherited from Any

Ungrouped