org.scalacheck

Gen

object Gen extends AnyRef

Contains combinators for building generators.

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

Type Members

  1. case class Params(size: Int, rng: Random) extends Product with Serializable

    Record that encapsulates all parameters required for data generation

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. def alphaChar: Gen[Char]

  7. def alphaLowerChar: Gen[Char]

  8. def alphaNumChar: Gen[Char]

  9. def alphaStr: Gen[String]

  10. def alphaUpperChar: Gen[Char]

  11. def apply[T](g: (Params) ⇒ Option[T]): Gen[T]

  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. 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.

  14. 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.

  15. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def containerOf[C[_], T](g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

    Generates a container of any type for which there exists an implicit Buildable instance.

    Generates a container of any type for which there exists an implicit 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.

  17. def containerOf1[C[_], T](g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

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

    Generates a non-empty container of any type for which there exists an implicit 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.

  18. def containerOfN[C[_], T](n: Int, g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

    Generates a container of any type for which there exists an implicit Buildable instance.

    Generates a container of any type for which there exists an implicit Buildable instance. The elements in the container will be generated by the given generator. The size of the generated container is given by n.

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

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

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

    A generator that never generates a value

  22. def finalize(): Unit

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

  24. def frequency[T](gs: (Int, Gen[T])*): Gen[T]

    Chooses one of the given generators with a weighted random distribution

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

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

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

  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. 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).

  30. def listOf1[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 containerOf1[List,T](g).

  31. 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).

  32. def lzy[T](g: ⇒ Gen[T]): Gen[T] { lazy val h: org.scalacheck.Gen[T] }

    Wraps a generator lazily.

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

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

    Definition Classes
    AnyRef
  34. 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.

  35. final def notify(): Unit

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

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

  38. def numStr: Gen[String]

  39. def oneOf[T](g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[T]

    Picks a random generator from a list

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

    Picks a random value from a list

  41. def parameterized[T](f: (Params) ⇒ Gen[T]): Gen[T]

    Creates a generator that can access its generation parameters

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

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

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

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

  44. 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.

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

    Creates a resized version of a generator

  46. def sequence[C[_], T](gs: Iterable[Gen[T]])(implicit b: Buildable[T, C]): Gen[C[T]]

    Sequences generators.

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

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

    Creates a generator that can access its generation size

  48. 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

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

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

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

    Definition Classes
    AnyRef
  51. def toString(): String

    Definition Classes
    AnyRef → Any
  52. implicit def value[T](x: T): Gen[T]

    A generator that always generates the given value

  53. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  56. 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.

Deprecated Value Members

  1. val defaultParams: Params

    Annotations
    @deprecated
    Deprecated

    Use Gen.Params() instead

  2. def elements[T](xs: T*): Gen[T]

    A generator that returns a random element from a list

    A generator that returns a random element from a list

    Annotations
    @deprecated
    Deprecated

    Use 'oneOf' with constant generators instead.

  3. def elementsFreq[T](vs: (Int, T)*): Gen[T]

    Chooses one of the given values, with a weighted random distribution.

    Chooses one of the given values, with a weighted random distribution.

    Annotations
    @deprecated
    Deprecated

    Use 'frequency' with constant generators instead.

  4. def negInt: Gen[Int]

    Annotations
    @deprecated
    Deprecated

    Use negNum[Int] instead

  5. def posInt: Gen[Int]

    Annotations
    @deprecated
    Deprecated

    Use posNum[Int] instead

  6. def vectorOf[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).

    Annotations
    @deprecated
    Deprecated

    Use 'listOfN' instead.

Inherited from AnyRef

Inherited from Any