com.pushtotest.tool.util
Class RandomIntGenerator

java.lang.Object
  extended by com.pushtotest.tool.util.RandomIntGenerator

public class RandomIntGenerator
extends java.lang.Object

Generates more random numbers than those generated by java.lang.Math.random() This class was originally written in Core Java 2, Volume 1 Fundamentals by Cay Horstmann and Garay Cornell, published by Prentice Hall, Pages 147-149 Core Java 2 credits the algorithm to: Donald E. Knuth's Semi-Numerical Algorithms, which is Volume 2 of his Art of Computer Programming [Addison-Wesley, 1981] book.


Constructor Summary
RandomIntGenerator(int l, int h)
          Constructs the class that encapsulates the random integer generator
 
Method Summary
 int draw()
          Returns an int containing a random integer in the range constructed
 java.lang.String drawString()
          Returns a String containing a random integer in the range constructed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomIntGenerator

public RandomIntGenerator(int l,
                          int h)
Constructs the class that encapsulates the random integer generator

Parameters:
1 - the lowest integer in the range
h - the highest integer in the range
Method Detail

drawString

public java.lang.String drawString()
Returns a String containing a random integer in the range constructed

Returns:
String representation of the random integer.

draw

public int draw()
Returns an int containing a random integer in the range constructed

Returns:
A random integer.