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

java.lang.Object
  extended by net.java.quickcheck.generator.support.VetoableGenerator<T>
      extended by net.java.quickcheck.generator.support.UniqueValuesGenerator<T>
All Implemented Interfaces:
Generator<T>, StatefulGenerator<T>

public class UniqueValuesGenerator<T>
extends VetoableGenerator<T>


Field Summary
 
Fields inherited from class net.java.quickcheck.generator.support.VetoableGenerator
DEFAULT_MAX_TRIES, MIN_TRIES
 
Constructor Summary
UniqueValuesGenerator(Generator<? extends T> generator, int defaultMaxTries)
           
 
Method Summary
 void reset()
          Resets the state of the generator to the state it had immediately after construction.
protected  boolean tryValue(T value)
           
 
Methods inherited from class net.java.quickcheck.generator.support.VetoableGenerator
next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.quickcheck.Generator
next
 

Constructor Detail

UniqueValuesGenerator

public UniqueValuesGenerator(Generator<? extends T> generator,
                             int defaultMaxTries)
Method Detail

tryValue

protected boolean tryValue(T value)
Specified by:
tryValue in class VetoableGenerator<T>
Returns:
true to accept the current value.

reset

public void reset()
Description copied from interface: StatefulGenerator
Resets the state of the generator to the state it had immediately after construction. Makes a heavy weight generator reusable.

Specified by:
reset in interface StatefulGenerator<T>


Copyright © 2011. All Rights Reserved.