objectdraw
Class RandomDoubleGenerator

java.lang.Object
  extended by objectdraw.RandomDoubleGenerator

public class RandomDoubleGenerator
extends Object

A RandomDoubleGenerator will produce a string of random doubles that are in the range it was created to produce. Each number x will satisfy min <= x < max, and the numbers will be distributed evenly and unpredictably within that range.

You can think of the generator as being like a set of dice, which I can roll over and over again (with nextValue()) to get different results each time. So, if I construct a new RandomIntGenerator(1, 10) it might produce 8.341, then 1.792, and so on.

Author:
Russell Zahniser (russell@zahniser.net)

Constructor Summary
RandomDoubleGenerator(double min, double max)
          Construct a random number generator that will deliver doubles in the given range.
 
Method Summary
 double nextValue()
          Return another random number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomDoubleGenerator

public RandomDoubleGenerator(double min,
                             double max)
Construct a random number generator that will deliver doubles in the given range.

Parameters:
min - Minimum value that may be produced
max - Maximum value that may be produced
Method Detail

nextValue

public double nextValue()
Return another random number

Returns:
Another number in the range of this generator