Package-level declarations

Contains types such as NotEmptyRange for manipulating ranges of comparable values.

Types

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
interface Bound<out T : Comparable<@UnsafeVariance T>>

Represents a bound in a range.

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
class ExclusiveBound<out T : Comparable<@UnsafeVariance T>> : Bound<T>

Represents an exclusive bound in a range.

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
class InclusiveBound<out T : Comparable<@UnsafeVariance T>> : Bound<T>

Represents an inclusive bound in a range.

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
class NotEmptyRange<out T : Comparable<@UnsafeVariance T>>

Represents a range of comparable values that contain at least one value.

Functions

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
operator fun <T : Comparable<T>> NotEmptyRange<T>.contains(value: T): Boolean

Returns true if this range contains the given value, or returns false otherwise.

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
fun <T : Comparable<T>> notEmptyRangeOf(bounds: NotEmptyRange.BuilderScope<T>.() -> Pair<Bound<T>, Bound<T>>): NotEmptyRange<T>

Returns a not empty range with the given pair of bounds. The resulting range will start with the lowest value between the given bounds.