Class el.Range

A numeric value range.

Functions

Range.new () Create an empty range.
Range.new (start, end) Create a new range.

Attributes

Range.min Minimum value.
Range.max Maximum value.

Methods

Range:empty () Returns true if the range has a length of zero.
Range:length () Returns the length (max - min).
Range:setLength (length) Set the length.


Functions

Range.new ()
Create an empty range.

Returns:

    kv.Range
Range.new (start, end)
Create a new range.

Parameters:

  • start number Start value
  • end number End value

Returns:

    kv.Range

Attributes

Range.min
Minimum value.

Set to change the start position of the range, leaving the end position unchanged. If the new start position is higher than the current end of the range, the end point will be pushed along to equal it, leaving an empty range at the new position.

Range.max
Maximum value.

Changes the end position of the range, leaving the start unchanged. If the new end position is below the current start of the range, the start point will be pushed back to equal the new end point.

Methods

Range:empty ()
Returns true if the range has a length of zero.

Returns:

    bool
Range:length ()
Returns the length (max - min).

Returns:

    number
Range:setLength (length)
Set the length.

Parameters:

  • length number New length to set.

Returns:

    number
generated by LDoc 1.5.0 Last updated 2024-02-18 20:31:17