public interface NumberService
Modifier and Type | Method and Description |
---|---|
String |
digits(int howMany)
Generates a string with a given length composed of random digits.
|
double |
nextDouble()
Generates a random positive double
|
double |
nextDouble(double upperBound)
Generates a random double between 0 (inclusive) and
upperBound (exclusive) |
double |
nextDouble(double lowerBound,
double upperBound)
Generates a random double between
lowerBound (inclusive) and upperBound (exclusive) |
float |
nextFloat()
Generates a random positive float between 0 and 1 (inclusive)
|
float |
nextFloat(float upperBound)
Generates a random float between 0 (inclusive) and
upperBound (exclusive) |
float |
nextFloat(float lowerBound,
float upperBound)
Generates a random float between
lowerBound and upperBound (inclusive) |
int |
nextInt()
Generates a random positive int
|
int |
nextInt(int upperBound)
Generates a random int between 0 and
upperBound (inclusive). |
int |
nextInt(int lowerBound,
int upperBound)
Generates a random int between
lowerBound and upperBound (inclusive). |
long |
nextLong()
Generates a random positive long
|
long |
nextLong(long upperBound)
Generates a random long between 0 and
upperBound (inclusive). |
long |
nextLong(long lowerBound,
long upperBound)
Generates a random long between @{code lowerBound} and
upperBound (inclusive) |
long nextLong()
int nextInt()
int nextInt(int upperBound)
upperBound
(inclusive).
If upperBound
equals Integer.MAX_VALUE
generates a random int between 0 (inclusive)
and upperBound
(exclusive).
int nextInt(int lowerBound, int upperBound)
lowerBound
and upperBound
(inclusive).
If upperBound
equals Integer.MAX_VALUE
generates a random int between
lowerBound
(inclusive) and upperBound
(exclusive).
long nextLong(long upperBound)
upperBound
(inclusive).
If upperBound
equals Long.MAX_VALUE
generates a random long between 0 (inclusive)
and upperBound
(exclusive).
long nextLong(long lowerBound, long upperBound)
upperBound
(inclusive)
If upperBound
equals Long.MAX_VALUE
generates a random long between
lowerBound
(inclusive) and upperBound
(exclusive).
double nextDouble()
double nextDouble(double upperBound)
upperBound
(exclusive)double nextDouble(double lowerBound, double upperBound)
lowerBound
(inclusive) and upperBound
(exclusive)float nextFloat()
float nextFloat(float upperBound)
upperBound
(exclusive)float nextFloat(float lowerBound, float upperBound)
lowerBound
and upperBound
(inclusive)String digits(int howMany)
Returns empty string if howMany
is equal or smaller than 0.
Copyright © 2022. All rights reserved.