Iterator generates ordered series of (keys and) values.
These keys and values can be retrived one at a time.
Constructor
Creates new iterator from given value.
Methods
Returns next key and element as map.
Checks if there are more elements available.
Checks if there are more elements available.
Injects a value to iterator. Injected value
is retrivable inside generator with
anvil.lang.eject().
Joins the elements of iterator together with given clue.
| Parameters |
clue -
Clue to join with, default is ", ".
|
Takes the key of next element. This method must
be called before next().
Retrieves the next element from iterator.
Iterates to end of iterator and returns last element.
If iterator didn't have any more elements, returns undefined.
Creates a new iterator which contains the rest of remainig
elements (and keys) of this iterator reversed.
Operation exhausts this iterator.
| Parameters |
amount -
Number of elements to skip
|
| Returns |
true if there are still more elements |
Sorts the elements in this iterator using given comparator function,
if comparator function is omitted natural ordering is used.
This operation unfolds the iterator to tree, and
returns depth-first iterator to generated tree.
| Parameters |
comparator -
Callable comparator, receiving parameters (value1, value2)
|
Operators
boolean (boolean)self
Returns true if there are more elements available
object *self
Returns next element from iterator.