Language

Random.From(IRandomGenerator) Method

Definition

Returns a Random for the specified generator.

[Android.Runtime.Register("from", "(Ljava/util/random/RandomGenerator;)Ljava/util/Random;", "", ApiSince=36)]
public static Java.Util.Random? From(Java.Util.RandomGenerators.IRandomGenerator? generator);
[<Android.Runtime.Register("from", "(Ljava/util/random/RandomGenerator;)Ljava/util/Random;", "", ApiSince=36)>]
static member From : Java.Util.RandomGenerators.IRandomGenerator -> Java.Util.Random

Parameters

generator
IRandomGenerator

The random generator that supplies results for the returned object's delegated method calls.

Returns

The specified generator if it is a Random; otherwise, a delegating Random.

Attributes

Remarks

If the generator is a Random, the same Java instance is returned. Otherwise, the returned Random delegates random generation to the supplied generator. Its SetSeed and protected Next methods throw UnsupportedOperationException. The delegating instance is not serializable.

Java reference for java.util.Random.from.

Applies to