case class SizeParam(minSize: PosZInt, sizeRange: PosZInt, size: PosZInt) extends Product with Serializable
Describes the "size" to use in order to generate a value.
The Generator.next() function takes a SizeParam
as a parameter, and uses it if it
is relevant to this Generator.
The semantics of "size" depend on the Generator and the type it is producing. For a
simple scalar such as an Int or a Float, "size" is irrelevant, and the parameter
is ignored. For a String, the "size" is the length of the desired String
. For a
List, the "size" is the length of the desired List
. And so on -- in general, the
meaning of "size" is usually pretty intuitive.
The SizeParam data structure represents both a target size range and a specific size.
The minSize
member says the smallest allowed size; the sizeRange
is added to
minSize
to get the largest allowed size. So if minSize
is 10 and sizeRange
is 0,
that means that 10 is the only size desired; if minSize
is 10 and sizeRange
is 10,
then values from 10 to 20 are desired.
The size
member gives the desired size for this particular invocation of Generator.next().
Most Generators will create a result of that size. However, it is up to the individual
Generator to choose how it interprets SizeParam.
You should not usually need to create a SizeParam directly -- most of the time, you should be able to use the HavingSize or HavingLength traits to describe the desired sizes of your Generators. You may occasionally need to manipulate SizeParam directly if you want to use HavingSize.havingSizesDeterminedBy(), or if you want to call Generator.next() directly.
- minSize
the minimum desired size for this Generator or invocation
- sizeRange
the range above minSize to consider allowable
- size
the actual size to use for this specific invocation of Generator.next()
- Source
- SizeParam.scala
- Alphabetic
- By Inheritance
- SizeParam
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SizeParam(minSize: PosZInt, sizeRange: PosZInt, size: PosZInt)
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 clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maxSize: PosZInt
The maximum size to allow.
- val minSize: PosZInt
- 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 productElementNames: Iterator[String]
- Definition Classes
- Product
- val size: PosZInt
- val sizeRange: PosZInt
- 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()