objectdraw
Class RandomIntGenerator

java.lang.Object
  extended by objectdraw.RandomIntGenerator

public class RandomIntGenerator
extends Object

A RandomIntGenerator will produce a string of random ints 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 3, then 7, then 5, and so on.

Author:
Russell Zahniser (russell@zahniser.net)

Constructor Summary
RandomIntGenerator(int min, int max)
          Construct a random number generator that will deliver ints in the given range.
 
Method Summary
 int 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

RandomIntGenerator

public RandomIntGenerator(int min,
                          int max)
Construct a random number generator that will deliver ints in the given range.

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

nextValue

public int nextValue()
Return another random number

Returns:
Another number in the range of this generator