net.java.quickcheck.generator
Class MutationGenerator<T,M>

java.lang.Object
  extended by net.java.quickcheck.generator.support.AbstractTransformerGenerator<T,T>
      extended by 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.


Constructor Summary
MutationGenerator(Generator<T> prototypeGenerator, Generator<M> mutationValueGenerator)
           
 
Method Summary
protected abstract  T mutate(T prototype, M mutation)
           For every generation of values mutate(Object, Object) will be called once.
protected  T transform(Generator<T> inputGenerator)
           
 
Methods inherited from class net.java.quickcheck.generator.support.AbstractTransformerGenerator
next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutationGenerator

public MutationGenerator(Generator<T> prototypeGenerator,
                         Generator<M> mutationValueGenerator)
Method Detail

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.