Class Range.Array

A array of Ranges.

Used for efficient handling of such arrays.

Functions

Array.new (array) Create a new array.
Array.pack (...) Create a new array from a variable number of arguments.
Array.from_table (array) Alias for new.

Methods

Array:unpack ([i=1[, j=length of array]]) Unpack the array.
Array:to_table () Convert the array to a Lua table.
Array:copy () Create a copy of the array.
Array:at (index) Get the Range at a given index.
Array:set_at (index, value) Set the Range at a given index.

Metamethods

Array:__len () Get the length of the array.
Array:__eq (other) Check equality of two arrays.


Functions

Array.new (array)
Create a new array.

If you do not already have a Lua table of the Ranges, consider using pack.

Parameters:

Returns:

    Array
Array.pack (...)
Create a new array from a variable number of arguments.

Parameters:

Returns:

    Array
Array.from_table (array)
Alias for new.

Parameters:

Returns:

    Array

Methods

Array:unpack ([i=1[, j=length of array]])
Unpack the array.

Inverse of pack if i and j are omitted.

Parameters:

  • i integer (default 1)
  • j integer last index to unpack (inclusive) (default length of array)

Returns:

    Range...
Array:to_table ()
Convert the array to a Lua table.

Inverse of from_table.

Returns:

    {Array}
Array:copy ()
Create a copy of the array.

Returns:

    Array
Array:at (index)
Get the Range at a given index.

Parameters:

  • index integer

Returns:

    Range

Raises:

Indexing a non-positive index.
Indexing beyond last element.
Array:set_at (index, value)
Set the Range at a given index.

Parameters:

  • index integer
  • value Range

Raises:

Indexing a non-positive index.
Indexing beyond last element.
Mutating an unmanaged array.

Metamethods

Array:__len ()
Get the length of the array.

Returns:

    integer
Array:__eq (other)
Check equality of two arrays.

Parameters:

Returns:

    boolean
generated by LDoc 1.5.0 Last updated 2024-04-16 14:22:44