public class ThreadLocalRandom

  1. Object
  2. Random
  3. ThreadLocalRandom

Methods

public static ThreadLocalRandom current()
public void setSeed(long seed)Sets the seed of this random number generator using a single long seed.
public int nextInt(int origin, int bound)
public long nextLong(long bound)
public long nextLong(long origin, long bound)
public double nextDouble(double bound)
public double nextDouble(double origin, double bound)

Inherited methods

Method details

current

public static ThreadLocalRandom current()

setSeed

public void setSeed(long seed)
Sets the seed of this random number generator using a single long seed. The general contract of setSeed is that it alters the state of this random number generator object so as to be in exactly the same state as if it had just been created with the argument seed as a seed. The method setSeed is implemented by class Random as follows: synchronized public void setSeed(long seed) { this.seed = (seed ^ 0x5DEECE66DL) & ((1L « 48) - 1); } The implementation of setSeed by class Random happens to use only 48 bits of the given seed. In general, however, an overriding method may use all 64 bits of the long argument as a seed value.

nextInt

public int nextInt(int origin, int bound)

nextLong

public long nextLong(long bound)

nextLong

public long nextLong(long origin, long bound)

nextDouble

public double nextDouble(double bound)

nextDouble

public double nextDouble(double origin, double bound)