Class Randomizer


public class Randomizer
extends Object
A utility class to create various random values.


Method Index

 o randomColor ()
 o randomInt (int, int)
Returns a random integer greater than or equal to min and less than or equal to max
 o randomLoc (Rectangle)
Generates a random location point subject to the constraint that 0<=X<=maxX and 0<=Y<=maxY
 o randomVel (Rectangle)
Returns a random velocity (as a Point) subject to the constraint that the absolute value of the vleocity (speed) is less than maxV

Methods

 o randomLoc
public Point randomLoc(Rectangle rect)
Generates a random location point subject to the constraint that 0<=X<=maxX and 0<=Y<=maxY.

 o randomInt
public int randomInt(int min, int max)
Returns a random integer greater than or equal to min and less than or equal to max.

 o randomVel
public Point randomVel(Rectangle rect)
Returns a random velocity (as a Point) subject to the constraint that the absolute value of the vleocity (speed) is less than maxV.

 o randomColor
public Color randomColor()