IT. Expert System.

Android Reference

Random


java.util

Class Random

    • Constructor Summary

      Constructors
      Constructor and Description
      Random()
      Constructs a random generator with an initial state that is unlikely to be duplicated by a subsequent instantiation.
      Random(long seed)
      Construct a random generator with the given seed as the initial state.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      protected int next(int bits)
      Returns a pseudo-random uniformly distributed int value of the number of bits specified by the argument bits as described by Donald E.
      boolean nextBoolean()
      Returns a pseudo-random uniformly distributed boolean.
      void nextBytes(byte[] buf)
      Fills buf with random bytes.
      double nextDouble()
      Returns a pseudo-random uniformly distributed double in the half-open range [0.0, 1.0).
      float nextFloat()
      Returns a pseudo-random uniformly distributed float in the half-open range [0.0, 1.0).
      double nextGaussian()
      Returns a pseudo-random (approximately) normally distributed double with mean 0.0 and standard deviation 1.0.
      int nextInt()
      Returns a pseudo-random uniformly distributed int.
      int nextInt(int n)
      Returns a pseudo-random uniformly distributed int in the half-open range [0, n).
      long nextLong()
      Returns a pseudo-random uniformly distributed long.
      void setSeed(long seed)
      Modifies the seed using a linear congruential formula presented in The Art of Computer Programming, Volume 2, Section 3.2.1.
    • Constructor Detail

      • Random

        public Random()
        Constructs a random generator with an initial state that is unlikely to be duplicated by a subsequent instantiation.

        The initial state (that is, the seed) is partially based on the current time of day in milliseconds.

      • Random

        public Random(long seed)
        Construct a random generator with the given seed as the initial state. Equivalent to Random r = new Random(); r.setSeed(seed);.

        This constructor is mainly useful for predictability in tests. The default constructor is likely to provide better randomness.

    • Method Detail

      • next

        protected int next(int bits)
        Returns a pseudo-random uniformly distributed int value of the number of bits specified by the argument bits as described by Donald E. Knuth in The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 3.2.1.

        Most applications will want to use one of this class' convenience methods instead.

      • nextBoolean

        public boolean nextBoolean()
        Returns a pseudo-random uniformly distributed boolean.
      • nextBytes

        public void nextBytes(byte[] buf)
        Fills buf with random bytes.
      • nextDouble

        public double nextDouble()
        Returns a pseudo-random uniformly distributed double in the half-open range [0.0, 1.0).
      • nextFloat

        public float nextFloat()
        Returns a pseudo-random uniformly distributed float in the half-open range [0.0, 1.0).
      • nextGaussian

        public double nextGaussian()
        Returns a pseudo-random (approximately) normally distributed double with mean 0.0 and standard deviation 1.0. This method uses the polar method of G. E. P. Box, M. E. Muller, and G. Marsaglia, as described by Donald E. Knuth in The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 3.4.1, subsection C, algorithm P.
      • nextInt

        public int nextInt()
        Returns a pseudo-random uniformly distributed int.
      • nextInt

        public int nextInt(int n)
        Returns a pseudo-random uniformly distributed int in the half-open range [0, n).
      • nextLong

        public long nextLong()
        Returns a pseudo-random uniformly distributed long.
      • setSeed

        public void setSeed(long seed)
        Modifies the seed using a linear congruential formula presented in The Art of Computer Programming, Volume 2, Section 3.2.1.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 128 / . Delta: 0.05017 с