core-ktx / androidx.util / android.util.Range

Extensions for android.util.Range

and

infix fun <T : Comparable<T>> Range<T>.and(other: Range<T>): Range<T>

Return the intersection of this range and other.

plus

operator fun <T : Comparable<T>> Range<T>.plus(value: T): Range<T>

Return the smallest range that includes this and value.

operator fun <T : Comparable<T>> Range<T>.plus(other: Range<T>): Range<T>

Return the smallest range that includes this and other.

toClosedRange

fun <T : Comparable<T>> Range<T>.toClosedRange(): ClosedRange<T>

Returns this Range as a ClosedRange.