net.java.quickcheck.generator.support
Class CloningGenerator<T>

java.lang.Object
  extended by net.java.quickcheck.generator.support.CloningGenerator<T>
Type Parameters:
T - Type of the prototype object
All Implemented Interfaces:
Generator<T>

public class CloningGenerator<T>
extends Object
implements Generator<T>

A cloning generator which uses object serialization to create clones of the prototype object. For each call of next() a new copy of the prototype will be generated.


Constructor Summary
CloningGenerator(T prototype)
           
 
Method Summary
 T next()
          Generate a new instance of the prototype object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloningGenerator

public CloningGenerator(T prototype)
Method Detail

next

public T next()
Generate a new instance of the prototype object.

Specified by:
next in interface Generator<T>
Returns:
a newly created instance


Copyright © 2011. All Rights Reserved.