public class RandomPointGenerator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private RandomVariate[] |
rv
A 2 element array that holds the instance of the x and y RandomVariate.
|
Constructor and Description |
---|
RandomPointGenerator(double[] corners)
Creates a new RandomPointGenerator with the x and y points uniformly distributed
between the minimum and maximum x and y specified.
|
RandomPointGenerator(java.awt.geom.Point2D[] cornerPoints)
Creates a new RandomPointGenerator with the specified corner points.
|
RandomPointGenerator(RandomVariate[] rv)
Creates a new instance of RandomPointGenerator with the given RandomVariates.
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Point2D |
generatePoint()
Generates the next point.
|
RandomVariate[] |
getRandomVariate() |
void |
setCornerPoints(java.awt.geom.Point2D[] corners) |
void |
setCorners(double[] corners)
Values are {minX, minY, maxX, maxY}
|
void |
setRandomVariate(RandomVariate[] rv)
Sets the RandomVariates for this RandomPointGenerator.
|
void |
setSeed(long seed)
Sets both supporting RandomNumbers to the same instance.
|
java.lang.String |
toString() |
private RandomVariate[] rv
public RandomPointGenerator(java.awt.geom.Point2D[] cornerPoints)
cornerPoints
- A two element array. The first point is the minimum x and y;
the second point is the maximum x and y.public RandomPointGenerator(double[] corners)
corners
- A four element array containing: the minimum x, the minimum y,
the maximum x, and the maximum y.java.lang.IllegalArgumentException
- If the array does not have exactly 4 elements.public RandomPointGenerator(RandomVariate[] rv)
rv
- A 2 element array containing the RandomVariate for x and y.public void setSeed(long seed)
seed
- new seed for the supporting RandomNumberpublic void setRandomVariate(RandomVariate[] rv)
rv
- A 2 element array containing the RandomVariate for x and y.java.lang.IllegalArgumentException
- If the array is not exactly 2 elements.public RandomVariate[] getRandomVariate()
public java.awt.geom.Point2D generatePoint()
public void setCornerPoints(java.awt.geom.Point2D[] corners)
corners
- 2-dimentional array specifying corners of regionjava.lang.IllegalArgumentException
- If the array is not exactly 2 elements.public void setCorners(double[] corners)
corners
- 4-dimensional array specifying cornersjava.lang.IllegalArgumentException
- If the array is not exactly 4 elements.public java.lang.String toString()
toString
in class java.lang.Object