All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class utils.RandNums

java.lang.Object
   |
   +----utils.RandNums

public class RandNums
extends Object
A simple random-number utility, created to shorten random-number function calls in programs


Constructor Index

 o RandNums()

Method Index

 o rand()
return random number n, such that 0 <= n < Integer.MAX_VALUE.
 o randIntRange(int, int)
return random number n, such that low <= n <= high, even if low > high.
 o setSeed(long)
"seed" the Random Number Generator (RNJ) with 'arg'.

Constructors

 o RandNums
 public RandNums()

Methods

 o setSeed
 public static void setSeed(long seed)
"seed" the Random Number Generator (RNJ) with 'arg'. You can make the RNJ repeatedly produce _exactly_ the same sequence of pseudorandom numbers by seeding and reseeding it with the same value - useful for debugging!

 o rand
 public static int rand()
return random number n, such that 0 <= n < Integer.MAX_VALUE.

 o randIntRange
 public static int randIntRange(int low,
                                int high)
return random number n, such that low <= n <= high, even if low > high.


All Packages  Class Hierarchy  This Package  Previous  Next  Index