Table of Contents

Class Random

Namespace
Albatross.Expression.Prefix
Assembly
Albatross.Expression.dll

Prefix expression that generates a random integer within a specified range. Takes two parameters: minimum (inclusive) and maximum (exclusive) values.

public class Random : PrefixExpression, IPrefixExpression, IExpression, IToken
Inheritance
Random
Implements
Inherited Members
Extension Methods

Constructors

Random()

Initializes a new instance of the Random class with name "Random" and exactly two parameters.

public Random()

Methods

Run(List<object>)

Generates a random integer between the minimum (inclusive) and maximum (exclusive) values. Uses the shared Random instance for thread safety.

protected override object Run(List<object> operands)

Parameters

operands List<object>

List containing exactly two operands: minimum and maximum integer values.

Returns

object

A random integer greater than or equal to min and less than max.

Exceptions

FormatException

Thrown when operands cannot be converted to integers.

ArgumentOutOfRangeException

Thrown when min is greater than max.