IterableExtension<T> extension

on

Properties

firstOption Option<T>
Returns the first element as an Option. If the list is empty, it will return None.
no setter
Returns the first element as an Option. If the list is empty, it will return None.
no setter
init Option<Iterable<T>>
Returns all the of elements except the last.
no setter
lastOption Option<T>
Returns the last element as an Option. If the list is empty, it will return None.
no setter
tail Option<Iterable<T>>
Returns all the of elements except the first.
no setter

Methods

append(T t) Iterable<T>
Returns a new iterable with the given element appended to the end.
elementAtOption(int index) Option<T>
Get the element at the given index as an Option. If the element does not exist, it will return None.
firstWhereOption(bool predicate(T element)) Option<T>
The first element satisfying predicate as an Option.
prepend(T t) Iterable<T>
Returns a new iterable with the given element prepended to the start.