Module lua-nucleo.enumerator

Enuminator tools

This file is a part of lua-nucleo library

Info:

  • Copyright: lua-nucleo authors (see file COPYRIGHT for the license)

Local Functions

enuminator.get_first (self) Returns minimum value.
enuminator.get_next (self, value) Returns next value for the given value.
enuminator.contains (self, value) Checks if the value has the next value.
make_enumerator_from_set (values) Makes enumerator from set.
make_enumerator_from_interval (first, last) Makes enumerator based on the passed interval boundaries with a step of 1.


Local Functions

enuminator.get_first (self)
Returns minimum value.

Parameters:

  • self enuminator

Returns:

    number Minimum value
enuminator.get_next (self, value)
Returns next value for the given value.

Parameters:

  • self enuminator
  • value number

Returns:

    number Next value.

Or

    nil If value is bigger than the maximum.

Raises:

Error if no next value is found.
enuminator.contains (self, value)
Checks if the value has the next value.

Parameters:

  • self enuminator
  • value number

Returns:

    boolean True, if self contains.
make_enumerator_from_set (values)
Makes enumerator from set.

Parameters:

  • values number[]

Returns:

    enuminator instance.
make_enumerator_from_interval (first, last)
Makes enumerator based on the passed interval boundaries with a step of 1.

Parameters:

  • first number Interval start.
  • last number Interval end.

Returns:

    enuminator instance.
generated by LDoc 1.4.6 Last updated 2021-04-22 13:57:02