IterableExtensions<T> extension

adds utility methods to Iterable

on

Properties

reversed Iterable<T>

Available on Iterable<T>, provided by the IterableExtensions extension

returns List.reversed of this. needs to convert to list first
no setter

Methods

elementAtOrNull(int index) → T?

Available on Iterable<T>, provided by the IterableExtensions extension

returns item at index or null
separated(T separator) Iterable<T>

Available on Iterable<T>, provided by the IterableExtensions extension

separates an iterable with separator only between items; i.e., not at the start or end
separatedList(T separator) List<T>

Available on Iterable<T>, provided by the IterableExtensions extension

separates an iterable with separator and cast to list
shiftLeft([int count = 1]) Iterable<T>

Available on Iterable<T>, provided by the IterableExtensions extension

shifts left by count
shiftRight([int count = 1]) Iterable<T>

Available on Iterable<T>, provided by the IterableExtensions extension

shifts right by count
toArray() List<T>

Available on Iterable<T>, provided by the IterableExtensions extension

returns this iterable as a fixed-length list
wrapped(T item) Iterable<T>

Available on Iterable<T>, provided by the IterableExtensions extension

wraps an iterable with item at the start and end
wrappedList(T item) List<T>

Available on Iterable<T>, provided by the IterableExtensions extension

wraps an iterable with item at the start and end and cast to list