Class RandomAdapter

java.lang.Object
java.util.Random
io.jenetics.util.RandomAdapter
All Implemented Interfaces:
Serializable, RandomGenerator

@Deprecated(since="8.3", forRemoval=true) public final class RandomAdapter extends Random
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in the next major version. Use the Random.from(RandomGenerator) method instead.
Some places in the Java API still require a Random object instead of the new RandomGenerator. This class can be used by using this adapter class.
final var random = RandomGenerator.getDefault();
final var bi = new BigInteger(100, RandomAdapter.of(random));
Since:
7.0
Version:
7.0
See Also:
  • Nested Class Summary

  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    doubles(double randomNumberOrigin, double randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    doubles(long streamSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    doubles(long streamSize, double randomNumberOrigin, double randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    ints(int randomNumberOrigin, int randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    ints(long streamSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    ints(long streamSize, int randomNumberOrigin, int randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    longs(long streamSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    longs(long randomNumberOrigin, long randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    longs(long streamSize, long randomNumberOrigin, long randomNumberBound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    nextBytes(byte[] bytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    nextDouble(double bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    nextDouble(double origin, double bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    float
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    float
    nextFloat(float bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    float
    nextFloat(float origin, float bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    double
    nextGaussian(double mean, double stddev)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    nextInt(int bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    nextInt(int origin, int bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    nextLong(long bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    nextLong(long origin, long bound)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static Random
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a new Random object from the given random generator.

    Methods inherited from class java.util.Random

    from, next, setSeed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isDeprecated

      public boolean isDeprecated()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • doubles

      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      doubles in interface RandomGenerator
      Overrides:
      doubles in class Random
    • doubles

      public DoubleStream doubles(double randomNumberOrigin, double randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      doubles in interface RandomGenerator
      Overrides:
      doubles in class Random
    • doubles

      public DoubleStream doubles(long streamSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      doubles in interface RandomGenerator
      Overrides:
      doubles in class Random
    • doubles

      public DoubleStream doubles(long streamSize, double randomNumberOrigin, double randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      doubles in interface RandomGenerator
      Overrides:
      doubles in class Random
    • ints

      public IntStream ints()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      ints in interface RandomGenerator
      Overrides:
      ints in class Random
    • ints

      public IntStream ints(int randomNumberOrigin, int randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      ints in interface RandomGenerator
      Overrides:
      ints in class Random
    • ints

      public IntStream ints(long streamSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      ints in interface RandomGenerator
      Overrides:
      ints in class Random
    • ints

      public IntStream ints(long streamSize, int randomNumberOrigin, int randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      ints in interface RandomGenerator
      Overrides:
      ints in class Random
    • longs

      public LongStream longs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      longs in interface RandomGenerator
      Overrides:
      longs in class Random
    • longs

      public LongStream longs(long randomNumberOrigin, long randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      longs in interface RandomGenerator
      Overrides:
      longs in class Random
    • longs

      public LongStream longs(long streamSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      longs in interface RandomGenerator
      Overrides:
      longs in class Random
    • longs

      public LongStream longs(long streamSize, long randomNumberOrigin, long randomNumberBound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      longs in interface RandomGenerator
      Overrides:
      longs in class Random
    • nextBoolean

      public boolean nextBoolean()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextBoolean in interface RandomGenerator
      Overrides:
      nextBoolean in class Random
    • nextBytes

      public void nextBytes(byte[] bytes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextBytes in interface RandomGenerator
      Overrides:
      nextBytes in class Random
    • nextFloat

      public float nextFloat()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextFloat in interface RandomGenerator
      Overrides:
      nextFloat in class Random
    • nextFloat

      public float nextFloat(float bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextFloat

      public float nextFloat(float origin, float bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextDouble

      public double nextDouble()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextDouble in interface RandomGenerator
      Overrides:
      nextDouble in class Random
    • nextDouble

      public double nextDouble(double bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextDouble

      public double nextDouble(double origin, double bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextInt

      public int nextInt()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextInt in interface RandomGenerator
      Overrides:
      nextInt in class Random
    • nextInt

      public int nextInt(int bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextInt in interface RandomGenerator
      Overrides:
      nextInt in class Random
    • nextInt

      public int nextInt(int origin, int bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextLong

      public long nextLong()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextLong in interface RandomGenerator
      Overrides:
      nextLong in class Random
    • nextLong

      public long nextLong(long bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextLong

      public long nextLong(long origin, long bound)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextGaussian

      public double nextGaussian()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      nextGaussian in interface RandomGenerator
      Overrides:
      nextGaussian in class Random
    • nextGaussian

      public double nextGaussian(double mean, double stddev)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • nextExponential

      public double nextExponential()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • of

      public static Random of(RandomGenerator random)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new Random object from the given random generator.
      Parameters:
      random - the random generator to adapt
      Returns:
      the adapted random generator