Klasse CustomGenerators.DoubleRandomNumberGenerator
java.lang.Object
ch.framedev.simplejavautils.CustomGenerators.DoubleRandomNumberGenerator
- Umschließende Klasse:
CustomGenerators
A nested class that generates random doubles within a specified range.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungInitializes a new instance of theDoubleRandomNumberGeneratorclass.DoubleRandomNumberGenerator(double min, double max) Initializes a new random number generator that generates random doubles within the specified range. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdoublegetMax()Gets the maximum value for the random double generation.doublegetMin()Gets the minimum value for the random double generation.doubleGenerates a random double within the specified range.setMax(double max) Sets the maximum value for the random double generation.setMin(double min) Sets the minimum value for the random double generation.
-
Konstruktordetails
-
DoubleRandomNumberGenerator
public DoubleRandomNumberGenerator()Initializes a new instance of theDoubleRandomNumberGeneratorclass. -
DoubleRandomNumberGenerator
public DoubleRandomNumberGenerator(double min, double max) Initializes a new random number generator that generates random doubles within the specified range.- Parameter:
min- the minimum value inclusivemax- the maximum value inclusive
-
-
Methodendetails
-
setMin
Sets the minimum value for the random double generation.- Parameter:
min- the minimum value inclusive- Gibt zurück:
- this instance for method chaining
-
setMax
Sets the maximum value for the random double generation.- Parameter:
max- the maximum value inclusive- Gibt zurück:
- this instance for method chaining
-
getMin
public double getMin()Gets the minimum value for the random double generation.- Gibt zurück:
- the minimum value inclusive
-
getMax
public double getMax()Gets the maximum value for the random double generation.- Gibt zurück:
- the maximum value inclusive
-
nextDouble
public double nextDouble()Generates a random double within the specified range.- Gibt zurück:
- a random double within the specified range
-