The maximum size to allow.
the minimum desired size for this Generator or invocation
the actual size to use for this specific invocation of Generator.next()
the range above minSize to consider allowable
Describes the "size" to use in order to generate a value.
The Generator.next() function takes a
SizeParamas 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
minSizemember says the smallest allowed size; thesizeRangeis added tominSizeto get the largest allowed size. So ifminSizeis 10 andsizeRangeis 0, that means that 10 is the only size desired; ifminSizeis 10 andsizeRangeis 10, then values from 10 to 20 are desired.The
sizemember 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()