com.caucho.util
Class RandomUtil

java.lang.Object
  extended by com.caucho.util.RandomUtil

public class RandomUtil
extends java.lang.Object

System-wide random number generator.


Constructor Summary
RandomUtil()
           
 
Method Summary
static long getRandomLong()
          Returns the next random long.
static double nextDouble()
          Returns the next random double between 0 and 1
static int nextInt(int n)
          Returns the next random int.
static void setTestSeed(long seed)
          Sets the specific seed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomUtil

public RandomUtil()
Method Detail

getRandomLong

public static long getRandomLong()
Returns the next random long.


nextInt

public static int nextInt(int n)
Returns the next random int.


nextDouble

public static double nextDouble()
Returns the next random double between 0 and 1


setTestSeed

public static void setTestSeed(long seed)
Sets the specific seed. Only for testing.