java.util.Random
An instance of this class is used to generate a stream of pseudo-random numbers. The class uses a 48-bit seed, which is modified using a linear congruential formula.
Some methods of Random class.
doubles(): This method returns an effectively unlimited stream of pseudorandom double values, each between zero (inclusive) and one(exclusive).
doubles(long): This method returns a stream producing the given streamSize number of pseudorandom double values, each between zero(inclusive) and one (exclusive).
doubles(double, double): This method returns an effectively unlimited stream of pseudorandom double values, each conforming to the given origin (inclusive) and bound(exclusive).
doubles(long, double, double): This method returns a stream producing the given streamSize number of pseudorandom double values, each conforming to the given origin(inclusive) and bound (exclusive).
equals(Object): This method indicates whether some other object is "equal to" this one.
hashCode(): This method returns a hash code value for the object.
ints(): This method returns an effectively unlimited stream of pseudorandom int values.
ints(long): This method returns a stream producing the given streamSize number of pseudorandom int values.
ints(int, int): This method returns an effectively unlimited stream of pseudorandom int values, each conforming to the given origin (inclusive) and bound(exclusive).
ints(long, int, int): This method returns a stream producing the given streamSize number of pseudorandom int values, each conforming to the given origin (inclusive) and bound (exclusive).
longs(): This method returns an effectively unlimited stream of pseudorandom long values.
longs(long): This method returns a stream producing the given streamSize number of pseudorandom long values.
longs(long, long): This method returns an effectively unlimited stream of pseudorandom long values, each conforming to the given origin (inclusive) and bound(exclusive).
longs(long, long, long): This method returns a stream producing the given streamSize number of pseudorandom long, each conforming to the given origin(inclusive) and bound (exclusive).
nextBoolean(): This method returns the next pseudorandom, uniformly distributed boolean value from this random number generator sequence.
nextBytes(byte[]): This method generates random bytes and places them into a user-supplied byte array.
nextDouble(): This method returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
nextFloat(): This method returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
nextGaussian(): This method returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
nextInt(): This method returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
nextInt(int): This method returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive).
nextLong(): This method returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
setSeed(long): This method sets the seed of this random number generator using a single long seed.
toString(): This method returns a string representation of the object.
No comments:
Post a Comment