Class VetoableGenerator<T>
- java.lang.Object
-
- de.cuioss.test.generator.internal.net.java.quickcheck.generator.support.VetoableGenerator<T>
-
- All Implemented Interfaces:
Generator<T>
- Direct Known Subclasses:
ExcludingGenerator,UniqueComparableValuesGenerator,UniqueValuesGenerator
public abstract class VetoableGenerator<T> extends Object implements Generator<T>
Base class for generators which can reject the values generated by their wrapped generator. This will be tried until the maximum number of tries is reached.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_TRIESstatic intMIN_TRIES
-
Constructor Summary
Constructors Modifier Constructor Description protectedVetoableGenerator(Generator<? extends T> generator)protectedVetoableGenerator(Generator<? extends T> generator, int maxTries)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tnext()Generates the next instance.protected abstract booleantryValue(T value)
-
-
-
Field Detail
-
DEFAULT_MAX_TRIES
public static final int DEFAULT_MAX_TRIES
- See Also:
- Constant Field Values
-
MIN_TRIES
public static final int MIN_TRIES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VetoableGenerator
protected VetoableGenerator(Generator<? extends T> generator)
-
VetoableGenerator
protected VetoableGenerator(Generator<? extends T> generator, int maxTries)
-
-
Method Detail
-
next
public T next() throws GeneratorException
Description copied from interface:GeneratorGenerates the next instance.- Specified by:
nextin interfaceGenerator<T>- Returns:
- a newly created instance
- Throws:
GeneratorException
-
-