Skip to content
Reference > Classes

Rand

Definition

Rand var = .... ;

Extends

Extended By

None

Method Summary

Owner Name Return Type Description
Rand constructor(seed, secure) Rand Creates a new Randomizer, used for generating random numbers. If a seed is provided, then the numbers generated are the same across runs.
Object getClassName() String Returns the string name of this object's class type.
Rand nextBoolean() Boolean return a random boolean value
Rand nextDouble(min, max) Double Returns a random Double between min and max values.
Rand nextGaussian() Double Return a random signed Double with a mean of 0, with a standard deviation of 1.
Rand nextGuid() String Returns a random string.
Rand nextInt(min, max) Integer Returns a random Integer between min and max values.
Rand nextUUID() UUID Returns a UUID object with a mean of 0, with a stdandard deviation of 1.
Rand shuffle(list) List Returns a new list with the values' positions randomly shuffled.
Object toJson() String Returns a json representation of this object.

Method Definitions


constructor(seed,secure)

Rand rand = new Rand(Number seed, Boolean secure)

Description

Creates a new Randomizer, used for generating random numbers. If a seed is provided, then the numbers generated are the same across runs.

Parameter Definition

Name Type Description
seed Number  seed, if null then the seed is random
secure Boolean  if true, then secure. if null or false, then not secure

nextBoolean()

Boolean Rand::nextBoolean()

Description

return a random boolean value


nextDouble(min,max)

Double Rand::nextDouble(Number min, Number max)

Description

Returns a random Double between min and max values.

Parameter Definition

Name Type Description
min Number  min number to be returned (inclusive). If null, then 0
max Number  max number to be returned (exclusive). If null, then 1

nextGaussian()

Double Rand::nextGaussian()

Description

Return a random signed Double with a mean of 0, with a standard deviation of 1.


nextGuid()

String Rand::nextGuid()

Description

Returns a random string.


nextInt(min,max)

Integer Rand::nextInt(Number min, Number max)

Description

Returns a random Integer between min and max values.

Parameter Definition

Name Type Description
min Number  min number to be returned (inclusive). If null, then 0
max Number  max number to be returned (exclusive). If null, then 1

nextUUID()

UUID Rand::nextUUID()

Description

Returns a UUID object with a mean of 0, with a stdandard deviation of 1.


shuffle(list)

List Rand::shuffle(List list)

Description

Returns a new list with the values' positions randomly shuffled.

Parameter Definition

Name Type Description
list List  list of values to shuffle