Package-level declarations

Functions

Link copied to clipboard
fun <E : Any> MutableCollection<E>.addOrThrow(element: E, lazyMessage: () -> Any = { "Element has already been added" })

Adds element to MutableCollection if it does not contain it yet. Throws an IllegalArgumentException with the result of calling lazyMessage if the collections already contains the element.

Link copied to clipboard
fun <T> List<T>.binaryFindFirst(predicate: (T) -> Boolean): T?

Searches this list for the first element matching the given predicate using the binary search algorithm. The list is expected to be sorted. Otherwise, the result is undefined.

Link copied to clipboard
fun <T> List<T>.binaryFindLast(predicate: (T) -> Boolean): T?

Searches this list for the last element matching the given predicate using the binary search algorithm. The list is expected to be sorted. Otherwise, the result is undefined.