case classSizeParam(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
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 desiredList
. 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; thesizeRange
is added tominSize
to get the largest allowed size. So ifminSize
is 10 andsizeRange
is 0, that means that 10 is the only size desired; ifminSize
is 10 andsizeRange
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.
the minimum desired size for this Generator or invocation
the range above minSize to consider allowable
the actual size to use for this specific invocation of Generator.next()