Class BitSetGenerator
java.lang.Object
com.pholser.junit.quickcheck.generator.Generator<BitSet>
com.pholser.junit.quickcheck.generator.java.util.BitSetGenerator
Produces values of type
BitSet.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoShrink(SourceOfRandomness random, BitSet larger) Gives some objects that are "smaller" than a given "larger" object.generate(SourceOfRandomness random, GenerationStatus status) Generates a value, possibly influenced by a source of randomness and metadata about the generation.Gives a hint to the shrinking process as to the magnitude of the given value.Methods inherited from class com.pholser.junit.quickcheck.generator.Generator
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, copy, gen, gen, hasComponents, narrow, numberOfNeededComponents, provide, shrink, types
-
Constructor Details
-
BitSetGenerator
public BitSetGenerator()
-
-
Method Details
-
generate
Description copied from interface:GenGenerates a value, possibly influenced by a source of randomness and metadata about the generation.- Parameters:
random- source of randomness to be used when generating the valuestatus- an object that can be used to influence the generated value. For example, generating lists can use thesizemethod to generate lists with a given number of elements.- Returns:
- the generated value
-
doShrink
Description copied from class:GeneratorGives some objects that are "smaller" than a given "larger" object.
Unless overridden, a generator will produce an empty list of "smaller" values.
-
magnitude
Description copied from class:GeneratorGives a hint to the shrinking process as to the magnitude of the given value. The shrinking process will prefer trying values of greater magnitude before values of lesser magnitude. If not overridden, this implementation returns "one".
Note to generator writers: Do not worry about normalizing a magnitude to a positive value; the shrinking mechanism will take care of it.
-