org.jcheck.generator
Class PercentageGen

java.lang.Object
  extended by org.jcheck.generator.PercentageGen
All Implemented Interfaces:
Gen<java.lang.Double>

public class PercentageGen
extends java.lang.Object
implements Gen<java.lang.Double>

Generator for doubles in the range [0.0-1.0).


Constructor Summary
PercentageGen()
           
 
Method Summary
 java.lang.Double arbitrary(java.util.Random random, long size)
           Returns an arbitrary object of type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PercentageGen

public PercentageGen()
Method Detail

arbitrary

public java.lang.Double arbitrary(java.util.Random random,
                                  long size)
Description copied from interface: Gen

Returns an arbitrary object of type T. The object should not have a size greater than size (or smaller than -size). What the size actually referrs to depends on the implementation, but it could be the number of nodes in a tree, pixels in an image etc.

The supplied random generator should be the only source of randomness used in the generator.

Specified by:
arbitrary in interface Gen<java.lang.Double>
Parameters:
random - the random generator that should be used when randomness is needed.
size - the limiting factor
Returns:
a random object