ThreadLocalRandom (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
static [ThreadLocalRandom](../../../java/util/concurrent/ThreadLocalRandom.html "class in java.util.concurrent")
[current](../../../java/util/concurrent/ThreadLocalRandom.html#current--)()
Returns the current thread's ThreadLocalRandom
.
[DoubleStream](../../../java/util/stream/DoubleStream.html "interface in java.util.stream")
[doubles](../../../java/util/concurrent/ThreadLocalRandom.html#doubles--)()
Returns an effectively unlimited stream of pseudorandom double
values, each between zero (inclusive) and one (exclusive).
[DoubleStream](../../../java/util/stream/DoubleStream.html "interface in java.util.stream")
[doubles](../../../java/util/concurrent/ThreadLocalRandom.html#doubles-double-double-)(double randomNumberOrigin, double randomNumberBound)
Returns an effectively unlimited stream of pseudorandom double
values, each conforming to the given origin (inclusive) and bound (exclusive).
[DoubleStream](../../../java/util/stream/DoubleStream.html "interface in java.util.stream")
[doubles](../../../java/util/concurrent/ThreadLocalRandom.html#doubles-long-)(long streamSize)
Returns a stream producing the given streamSize
number of pseudorandom double
values, each between zero (inclusive) and one (exclusive).
[DoubleStream](../../../java/util/stream/DoubleStream.html "interface in java.util.stream")
[doubles](../../../java/util/concurrent/ThreadLocalRandom.html#doubles-long-double-double-)(long streamSize, double randomNumberOrigin, double randomNumberBound)
Returns a stream producing the given streamSize
number of pseudorandom double
values, each conforming to the given origin (inclusive) and bound (exclusive).
[IntStream](../../../java/util/stream/IntStream.html "interface in java.util.stream")
[ints](../../../java/util/concurrent/ThreadLocalRandom.html#ints--)()
Returns an effectively unlimited stream of pseudorandom int
values.
[IntStream](../../../java/util/stream/IntStream.html "interface in java.util.stream")
[ints](../../../java/util/concurrent/ThreadLocalRandom.html#ints-int-int-)(int randomNumberOrigin, int randomNumberBound)
Returns an effectively unlimited stream of pseudorandom int
values, each conforming to the given origin (inclusive) and bound (exclusive).
[IntStream](../../../java/util/stream/IntStream.html "interface in java.util.stream")
[ints](../../../java/util/concurrent/ThreadLocalRandom.html#ints-long-)(long streamSize)
Returns a stream producing the given streamSize
number of pseudorandom int
values.
[IntStream](../../../java/util/stream/IntStream.html "interface in java.util.stream")
[ints](../../../java/util/concurrent/ThreadLocalRandom.html#ints-long-int-int-)(long streamSize, int randomNumberOrigin, int randomNumberBound)
Returns a stream producing the given streamSize
number of pseudorandom int
values, each conforming to the given origin (inclusive) and bound (exclusive).
[LongStream](../../../java/util/stream/LongStream.html "interface in java.util.stream")
[longs](../../../java/util/concurrent/ThreadLocalRandom.html#longs--)()
Returns an effectively unlimited stream of pseudorandom long
values.
[LongStream](../../../java/util/stream/LongStream.html "interface in java.util.stream")
[longs](../../../java/util/concurrent/ThreadLocalRandom.html#longs-long-)(long streamSize)
Returns a stream producing the given streamSize
number of pseudorandom long
values.
[LongStream](../../../java/util/stream/LongStream.html "interface in java.util.stream")
[longs](../../../java/util/concurrent/ThreadLocalRandom.html#longs-long-long-)(long randomNumberOrigin, long randomNumberBound)
Returns an effectively unlimited stream of pseudorandom long
values, each conforming to the given origin (inclusive) and bound (exclusive).
[LongStream](../../../java/util/stream/LongStream.html "interface in java.util.stream")
[longs](../../../java/util/concurrent/ThreadLocalRandom.html#longs-long-long-long-)(long streamSize, long randomNumberOrigin, long randomNumberBound)
Returns a stream producing the given streamSize
number of pseudorandom long
, each conforming to the given origin (inclusive) and bound (exclusive).
protected int
[next](../../../java/util/concurrent/ThreadLocalRandom.html#next-int-)(int bits)
Generates the next pseudorandom number.
boolean
[nextBoolean](../../../java/util/concurrent/ThreadLocalRandom.html#nextBoolean--)()
Returns a pseudorandom boolean
value.
double
[nextDouble](../../../java/util/concurrent/ThreadLocalRandom.html#nextDouble--)()
Returns a pseudorandom double
value between zero (inclusive) and one (exclusive).
double
[nextDouble](../../../java/util/concurrent/ThreadLocalRandom.html#nextDouble-double-)(double bound)
Returns a pseudorandom double
value between 0.0 (inclusive) and the specified bound (exclusive).
double
[nextDouble](../../../java/util/concurrent/ThreadLocalRandom.html#nextDouble-double-double-)(double origin, double bound)
Returns a pseudorandom double
value between the specified origin (inclusive) and bound (exclusive).
float
[nextFloat](../../../java/util/concurrent/ThreadLocalRandom.html#nextFloat--)()
Returns a pseudorandom float
value between zero (inclusive) and one (exclusive).
double
[nextGaussian](../../../java/util/concurrent/ThreadLocalRandom.html#nextGaussian--)()
Returns the next pseudorandom, Gaussian ("normally") distributeddouble
value with mean 0.0
and standard deviation 1.0
from this random number generator's sequence.
int
[nextInt](../../../java/util/concurrent/ThreadLocalRandom.html#nextInt--)()
Returns a pseudorandom int
value.
int
[nextInt](../../../java/util/concurrent/ThreadLocalRandom.html#nextInt-int-)(int bound)
Returns a pseudorandom int
value between zero (inclusive) and the specified bound (exclusive).
int
[nextInt](../../../java/util/concurrent/ThreadLocalRandom.html#nextInt-int-int-)(int origin, int bound)
Returns a pseudorandom int
value between the specified origin (inclusive) and the specified bound (exclusive).
long
[nextLong](../../../java/util/concurrent/ThreadLocalRandom.html#nextLong--)()
Returns a pseudorandom long
value.
long
[nextLong](../../../java/util/concurrent/ThreadLocalRandom.html#nextLong-long-)(long bound)
Returns a pseudorandom long
value between zero (inclusive) and the specified bound (exclusive).
long
[nextLong](../../../java/util/concurrent/ThreadLocalRandom.html#nextLong-long-long-)(long origin, long bound)
Returns a pseudorandom long
value between the specified origin (inclusive) and the specified bound (exclusive).
void
[setSeed](../../../java/util/concurrent/ThreadLocalRandom.html#setSeed-long-)(long seed)
Throws UnsupportedOperationException
.