fm.liveswitch.Randomizer Class Reference

Utility class for random values. More...

Public Member Functions

int next ()
 Returns a nonnegative random number. More...
 
int next (int maxValue)
 Returns a nonnegative random number less than the specified maximum. More...
 
int next (int minValue, int maxValue)
 Returns a random number within a specified range. More...
 
void nextBytes (byte[] buffer)
 Fills the elements of a specified array of bytes with random numbers. More...
 
double nextDouble ()
 Returns a random number between 0.0 and 1.0. More...
 
String randomString (int size)
 Generates a random string of a specified size. More...
 

Detailed Description

Utility class for random values.

Member Function Documentation

◆ next() [1/3]

int fm.liveswitch.Randomizer.next ( )

Returns a nonnegative random number.

Returns

◆ next() [2/3]

int fm.liveswitch.Randomizer.next ( int  maxValue)

Returns a nonnegative random number less than the specified maximum.

Parameters
maxValueThe maximum value (exclusive).
Returns

◆ next() [3/3]

int fm.liveswitch.Randomizer.next ( int  minValue,
int  maxValue 
)

Returns a random number within a specified range.

Parameters
minValueThe minimum value (inclusive).
maxValueThe maximum value (exclusive).
Returns

◆ nextBytes()

void fm.liveswitch.Randomizer.nextBytes ( byte[]  buffer)

Fills the elements of a specified array of bytes with random numbers.

Parameters
bufferThe array of bytes to fill.

◆ nextDouble()

double fm.liveswitch.Randomizer.nextDouble ( )

Returns a random number between 0.0 and 1.0.

Returns

◆ randomString()

String fm.liveswitch.Randomizer.randomString ( int  size)

Generates a random string of a specified size.

Parameters
sizeThe size of the output string.
Returns