All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.Randomizer

java.lang.Object
   |
   +----java.util.Random
           |
           +----COM.objectspace.jgl.Randomizer

public class Randomizer
extends Random
An easy-to-use random number generator.


Constructor Index

 o Randomizer()
Initializes the generator using a seed based on the current time.
 o Randomizer(long)
Initializes the generator using a specific seed; useful for generating a repeatable stream of random numbers.

Method Index

 o getDouble(double)
Generate a random number using the default generator.
 o getDouble(double, double)
Generate a random number using the default generator.
 o getFloat(float)
Generate a random number using the default generator.
 o getFloat(float, float)
Generate a random number using the default generator.
 o getInt(int)
Generate a random number using the default generator.
 o getInt(int, int)
Generate a random number using the default generator.
 o getLong(long)
Generate a random number using the default generator.
 o getLong(long, long)
Generate a random number using the default generator.
 o nextDouble(double)
Generates a double value between 1.0 and the given limit.
 o nextDouble(double, double)
Generates a double value between the given limits.
 o nextFloat(float)
Generates a float value between 1.0 and the given limit.
 o nextFloat(float, float)
Generates a float value between the given limits.
 o nextInt(int)
Generates an int value between 1 and the given limit.
 o nextInt(int, int)
Generates an int value between the given limits.
 o nextLong(long)
Generates a long value between 1 and the given limit.
 o nextLong(long, long)
Generates a long value between the given limits.

Constructors

 o Randomizer
  public Randomizer()
Initializes the generator using a seed based on the current time.

 o Randomizer
  public Randomizer(long seed)
Initializes the generator using a specific seed; useful for generating a repeatable stream of random numbers.

Parameters:
seed - The initial seed.
See Also:
setSeed

Methods

 o nextInt
  public int nextInt(int hi)
Generates an int value between 1 and the given limit.

Parameters:
hi - The upper bound.
Returns:
An integer value.
See Also:
nextInt
 o nextInt
  public int nextInt(int lo,
                     int hi)
Generates an int value between the given limits.

Parameters:
lo - The lower bound.
hi - The upper bound.
Returns:
An integer value.
See Also:
nextInt
 o nextLong
  public long nextLong(long hi)
Generates a long value between 1 and the given limit.

Parameters:
hi - The upper bound.
Returns:
A long value.
See Also:
nextLong
 o nextLong
  public long nextLong(long lo,
                       long hi)
Generates a long value between the given limits.

Parameters:
lo - The lower bound.
hi - The upper bound.
Returns:
A long integer value.
See Also:
nextLong
 o nextFloat
  public float nextFloat(float hi)
Generates a float value between 1.0 and the given limit.

Parameters:
hi - The upper bound.
Returns:
A float value.
See Also:
nextFloat
 o nextFloat
  public float nextFloat(float lo,
                         float hi)
Generates a float value between the given limits.

Parameters:
lo - The lower bound.
hi - The upper bound.
Returns:
A float value.
See Also:
nextFloat
 o nextDouble
  public double nextDouble(double hi)
Generates a double value between 1.0 and the given limit.

Parameters:
hi - The upper bound.
Returns:
A double value.
See Also:
nextDouble
 o nextDouble
  public double nextDouble(double lo,
                           double hi)
Generates a double value between the given limits.

Parameters:
lo - The lower bound.
hi - The upper bound.
Returns:
A double value.
See Also:
nextDouble
 o getInt
  public static int getInt(int hi)
Generate a random number using the default generator.

See Also:
nextInt
 o getInt
  public static int getInt(int lo,
                           int hi)
Generate a random number using the default generator.

See Also:
nextInt
 o getLong
  public static long getLong(long hi)
Generate a random number using the default generator.

See Also:
nextLong
 o getLong
  public static long getLong(long lo,
                             long hi)
Generate a random number using the default generator.

See Also:
nextLong
 o getFloat
  public static float getFloat(float hi)
Generate a random number using the default generator.

See Also:
nextFloat
 o getFloat
  public static float getFloat(float lo,
                               float hi)
Generate a random number using the default generator.

See Also:
nextFloat
 o getDouble
  public static double getDouble(double hi)
Generate a random number using the default generator.

See Also:
nextDouble
 o getDouble
  public static double getDouble(double lo,
                                 double hi)
Generate a random number using the default generator.

See Also:
nextDouble

All Packages  Class Hierarchy  This Package  Previous  Next  Index