IterableComparableExtension<T extends Comparable<T> > extension
Extensions that apply to iterables of Comparable elements.
These operations can assume that the elements have a natural ordering, and can therefore omit, or make it optional, for the user to provide a Comparator.
- on
-
- Iterable<
T>
- Iterable<
Properties
- max → T
-
Available on Iterable<
A maximal element of the iterable.T> , provided by the IterableComparableExtension extensionno setter - maxOrNull → T?
-
Available on Iterable<
A maximal element of the iterable, orT> , provided by the IterableComparableExtension extensionnull
if the iterable is empty.no setter - min → T
-
Available on Iterable<
A minimal element of the iterable.T> , provided by the IterableComparableExtension extensionno setter - minOrNull → T?
-
Available on Iterable<
A minimal element of the iterable, orT> , provided by the IterableComparableExtension extensionnull
it the iterable is empty.no setter
Methods
-
isSorted(
[Comparator< T> ? compare]) → bool -
Available on Iterable<
Whether the elements are sorted by theT> , provided by the IterableComparableExtension extensioncompare
ordering. -
sorted(
[Comparator< T> ? compare]) → List<T> -
Available on Iterable<
Creates a sorted list of the elements of the iterable.T> , provided by the IterableComparableExtension extension