Iterable interface: When called, returns an Iterator of type T
Returns an Iter instance yielding the values resulting from the iterator output of the createIterator
function receiving this iterable as an argument.
the result iterator element type
a function receiving the current iterable and returning an iterator of new elements
Applies the values of the current Iter to the given collector
and returns the result.
the collector to apply
Returns an Iter that yields each distinct value of this Iter at most once.
Returns an Iter that applies the given keyFun
to each element, and will yield only elements for which keyFun
returns a key that was not calculated before.
the type of key that the key function returns
a function that, given an element and its index, returns a calculated key
Returns an Iter that skips the first given amount of elements of this Iter, then yields all following elements, if present.
the amount of elements to skip
Returs an Iter that skips the last amount
of elements of this Iter.
the amount of elements to skip
iter.range(0, 10).dropLast(5)
result: (0, 1, 2, 3, 4)
Returns an Iter that yields elements from this Iter, only when the element is different from the previous value.
Returns an Iter that yields those elements that satify the given pred
predicate.
a function that take the current element, and the optional previous element and returns a boolean indicating its filter status
Returns an Iter that yields all values from the iterables resulting from applying the given flatMapFun to each element in this iter.
the elements of the Iterables resulting from flatMapFun
a function taking an element from this Iter and returning an iterable with elements of type R
Applies the given effect function to each element of the Iter, with its index. Note: eagerly gets all values from the iterable.
a function taking an element of the Iter and optionally its index and performs some side-effect.
Returns an Iter with the indices of the this Iter where the element equals the given elem
value.
the element to compare to
Returns an Iter that indefinitely yields one value of this Iter and then one value from each given iterable, starting back at the start of each iterable if it is exhausted.
a non-empty list of iterables to interleave with.
Returns an Iter that yields the elements of this Iter with the given interIter elements as a sepatator
an iterator of elements that is used as a separator
Returns a string starting with the given start string, then each element of this Iter separated by the given sep string, and ending with the end string.
the seperator string
the start string
the end string
Returns an Iter where the given mapFun is applied to each yielded element, with its index.
the result type of the given mapFun
a function taking an element of this Iter, and optionally its index, and returning a new element of type R
Returns an Iter that starts with the startIter elements, then yields all elements of this Iter with the sepIter elements as separators, and ends with the endIter elements.
the start elements
the separator elements
the end elements
Allows side-effects at any point in the chain, but does not modify the Iter.
a tag that can be used when performing the side-effect
the side-effect to perform for each yielded element
Returns an Iter where at the given index
, the given amount
of elements is skipped,
and the optional insert
function is called to generate an iterable based on the matching element and its index, after
which that iterable is yielded.
the index at which to patch
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
Returns an Iter where for each element of this Iter that equals the given elem
, the given amount
of elements is skipped,
and the optional insert
iterable is yielded.
the element to patch
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
an optional amount of elements to patch
Returns an Iter where for each element of this Iter that satisfies pred
, the given amount
of elements is skipped,
and the optional insert
function is called to generate an iterable based on the matching element and its index, after
which that iterable is yielded.
a predicate for an element of this Iter and its index
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
the optional amount of times to perform the patch
Returns the result of applying the reducer function to each element of this Iter, or returns the otherwise value if this Iter is empty.
the reducer function taking the current reducer value and the next element of this Iter, and returning a new value
specifies how to deal with the potential case that this Iter is empty. There are three cases:
f()
Repeats the current Iter the given times
amount of times, or indefinately if times
is undefined.
the amount of times to repeat this Iter
Returns an Iter that yields only each given nth
value of this Iter.
the amount of elements to skip every in between emissions.
Returns an Iter that yields the items of this Iter starting at the from index, and then yields the specified amount of items, if present.
the index at which to start yielding values
the maximum amount of items to yield
Returns an Iter that yields arrays of the given size of values from this Iter, each shifted that the given step Note: the last window may be smaller than the given size.
the window size
the amount of elements to shift the next window
Returns an Iter that yields arrays of values of this Iter each time a value that equals given elem is encountered
the element on which a new split should be made
Returns an Iter that yields the first given amount of elements of this Iter if present, then ends.
the amount of elements to yield
Returs an Iter that yields the last amount
of elements of this Iter.
the amount of elements to yield
iter.range(0, 10).takeLast(3)
result: (7, 8, 9)
Returns an array with all the values in this Iter
Returns this Iter as an asynchronous AsyncIter instance
Returns a Set with all the unique values in this Iter
Returns a fixed tag string to void unnecessary evaluation of iterable items.
Returns an Iter yielding tuples of each next element of this Iter and the provided iterables. If any of the iterables is done, the resulting Iter will end. Note that the type of the first iterable is taken into account, the other iterable elements will be case to any.
the type of the Iter elements of the first given iterable
the other iterables to zip
Returns an Iter containing tuples of each next element of this Iter and the provided iterables. If any of the iterables is done, the resulting values will be undefined. If all iterables are done, the resulting Iter ends. Note that the type of the first iterable is taken into account, the other iterable elements will be case to any.
the type of the Iter elements of the first given iterable
the other iterables to zip
Returns an Iter yielding the result from applying the given zipFun to the next element of this Iter and each next element of the given iterables. If any of the iterables is done, the element will be undefined. If all iterables are done, the resulting Iter ends. Note that the type of the first iterable is taken into account, however the other iterable elements will be cast to any.
the type of the Iter elements of the first given iterable
the result of applying the zipFun function to the next elements of all given iterables
a function taking one element from this and the given iterables, and returns a resulting element that will be yielded, accepting undefined for each non-present value
the other iterables to zip
Returns an Iter yielding the result from applying the given zipFun to the next element of this Iter and each next element of the given iterables. If any of the iterables is done, the resulting Iter also ends. Note that the type of the first iterable is taken into account, however the other iterable elements will be cast to any.
the type of the Iter elements of the first given iterable
the result of applying the zipFun function to the next elements of all given iterables
a function taking one element from this and the given iterables, and returns a resulting element that will be yielded
the other iterables to zip
Returns an Iter yielding tuples of the elements of this Iter as first elements, and their indices as second element.
Returns an Iter yielding items from an iterable
The type of elements the Iterable yields.
the source iterable
Generated using TypeDoc
Enrichment class allowing for manipulation of synchronous iterables.
the element type.