ListX<E> extension

on

Properties

firstIndex int
Index of the first element or -1 if the collection is empty.
no setter
indices Iterable<int>
no setter
lastIndex int
Index of the last element or -1 if the collection is empty.
no setter

Methods

binarySearch(E value, {int compare(E a, E b)?}) int
Returns a position of the value in this list, if it is there.
drop(int n) List<E>
Returns a new list containing all elements except first n elements.
dropLast(int n) List<E>
Returns a new list containing all elements except last n elements.
dropLastWhile(bool predicate(E element)) List<E>
Returns a new list containing all elements except last elements that satisfy the given predicate.
dropWhile(bool predicate(E element)) List<E>
Returns a new list containing all elements except last elements that satisfy the given predicate.
insertionSort({Comparator<E>? comparator, int start = 0, int? end}) → void
Sort this list between start (inclusive) and end (exclusive) using insertion sort.
lowerBound(E value, {int compare(E a, E b)?}) int
Returns the first position in this list that does not compare less than value.
mergeSort({int start = 0, int? end, Comparator<E>? comparator}) → void
Sorts this list between start (inclusive) and end (exclusive) using the merge sort algorithm.
swap(int indexA, int indexB) → void
Swaps the elements in the indices provided.