net.java.quickcheck.generator
Class MutationGenerator<T,M>
java.lang.Object
net.java.quickcheck.generator.support.AbstractTransformerGenerator<T,T>
net.java.quickcheck.generator.MutationGenerator<T,M>
- Type Parameters:
T
- Type of the generated value and prototype.M
- Type of the mutation value.
- All Implemented Interfaces:
- Generator<T>
- Direct Known Subclasses:
- CloningMutationGenerator
public abstract class MutationGenerator<T,M>
- extends AbstractTransformerGenerator<T,T>
Generator based on mutation of prototype objects with a arbitrary generated
mutation values.
Concrete implementation of this abstract class have to implement the
mutate(Object, Object)
method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MutationGenerator
public MutationGenerator(Generator<T> prototypeGenerator,
Generator<M> mutationValueGenerator)
transform
protected T transform(Generator<T> inputGenerator)
- Specified by:
transform
in class AbstractTransformerGenerator<T,T>
mutate
protected abstract T mutate(T prototype,
M mutation)
For every generation of values
mutate(Object, Object)
will be called once. The
first parameter is a fresh prototype object and the second value is an
arbitrary value which can be used in concrete implementations of this
abstract class to change the state of prototype value.
Copyright © 2011. All Rights Reserved.