Murl Engine Lua Addon API  Version 1.0 beta
Murl.Math.MinMax

The minimum maximum values template class.

This template can be specialized with UInt32, SInt32, UInt64, SInt64, Float and Double, e.g:

Math::MinMax<SInt32> range;

Specialization of other datatypes require the LimitsType template parameter, e.g. use of System::Time:

Math::MinMax<System::Time, System::Time> timeRange;


Table members

Functions


Murl.Math.MinMax.new()

The default constructor. Initialize the minimum with LimitsType::Max() and the maximum with LimitsType::Min().

Murl.Math.MinMax new()

Returns
Murl.Math.MinMax

Murl.Math.MinMax.new(min, max)

Constructor to initialize with a given minimum and maximum value.

Murl.Math.MinMax new(Number min, Number max)

Parameters
minThe minimum value.
maxThe maximum value.
Returns
Murl.Math.MinMax

Murl.Math.MinMax.new(values)

Constructor to initialize with given values. Initialize the minimum with LimitsType::Max() and the maximum with LimitsType::Min() and Add() values from an array.

Murl.Math.MinMax new(Murl.Array.Double values)

Parameters
valuesThe values to add.
Returns
Murl.Math.MinMax


Methods


Reset()

Reset the minimum and maximum value. Set the minimum to LimitsType::Max() and the maximum to LimitsType::Min().

Reset()


Add(value)

Add a value. Set the minimum to the value if the value is less than the current minimum. Set the maximum to the value if the value is greater than the current maximum.

Add(Number value)

Parameters
valueThe value to add.

Add(values)

Add values. Add() all values from an array.

Add(Murl.Array.Double values)

Parameters
valuesThe values to add.

GetMin()

Get the minimum.

Number GetMin()

Returns
Number The minimum.

GetMax()

Get the maximum.

Number GetMax()

Returns
Number The maximum.

IsInRange(value)

Check if a value is in minimum / maximum range.

Boolean IsInRange(Number value)

Parameters
valueThe value to check.
Returns
Boolean true if the value is greater or equal the minimum and less or equal the maximum.

IsInRangeEx(value)

Check if a value is in minimum / maximum range excluding the bounds.

Boolean IsInRangeEx(Number value)

Parameters
valueThe value to check.
Returns
Boolean true if the value is greater the minimum and less the maximum.

IsInRangeExMin(value)

Check if a value is in minimum / maximum range excluding minimum.

Boolean IsInRangeExMin(Number value)

Parameters
valueThe value to check.
Returns
Boolean true if the value is greater the minimum and less or equal the maximum.

IsInRangeExMax(value)

Check if a value is in minimum / maximum range excluding maximum.

Boolean IsInRangeExMax(Number value)

Parameters
valueThe value to check.
Returns
Boolean true if the value is greater or equal the minimum and less the maximum.

Unite(other)

Unite this MinMax with another MinMax object.

Unite(Murl.Math.MinMax other)

Parameters
otherThe other MinMax object to unite.

SetMin(min)

Set the minimum.

SetMin(Number min)

Parameters
minThe minimum to set.

SetMax(max)

Set the maximum.

SetMax(Number max)

Parameters
maxThe maximum to set.

Set(min, max)

Set the minimum and the maximum.

Set(Number min, Number max)

Parameters
minThe maximum to set.
maxThe maximum to set.

ToString()

Get the string representation of the object.

String ToString()

Returns
String The string representation of the object.


Metamethods


The tostring operator

Converts the object content to a string in a reasonable format.

Returns
ToString()

The equal to operator.

Equal to comparison operator.

Returns
Boolean = Murl.Math.MinMax == Murl.Math.MinMax