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

Properties

max → T

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

A maximal element of the iterable.
no setter
maxOrNull → T?

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

A maximal element of the iterable, or null if the iterable is empty.
no setter
min → T

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

A minimal element of the iterable.
no setter
minOrNull → T?

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

A minimal element of the iterable, or null it the iterable is empty.
no setter

Methods

isSorted([Comparator<T>? compare]) bool

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

Whether the elements are sorted by the compare ordering.
sorted([Comparator<T>? compare]) List<T>

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

Creates a sorted list of the elements of the iterable.