RangeKt

public final class RangeKt


Summary

Public methods

static final @RequiresApi(value = 21) @NonNull Range<@NonNull T>
<T extends Comparable<T>> RangeKt.and(Range<T> receiver, Range<T> other)

Return the intersection of this range and other.

static final @RequiresApi(value = 21) @NonNull Range<@NonNull T>
<T extends Comparable<T>> RangeKt.plus(Range<T> receiver, T value)

Return the smallest range that includes this and value.

static final @RequiresApi(value = 21) @NonNull Range<@NonNull T>
<T extends Comparable<T>> RangeKt.plus(Range<T> receiver, Range<T> other)

Return the smallest range that includes this and other.

static final @RequiresApi(value = 21) @NonNull Range<@NonNull T>
<T extends Comparable<T>> RangeKt.rangeTo(T receiver, T that)

Creates a range from this Comparable value to that.

static final @RequiresApi(value = 21) @NonNull ClosedRange<@NonNull T>
<T extends Comparable<T>> RangeKt.toClosedRange(Range<T> receiver)

Returns this Range as a ClosedRange.

static final @RequiresApi(value = 21) @NonNull Range<@NonNull T>
<T extends Comparable<T>> RangeKt.toRange(ClosedRange<T> receiver)

Returns this ClosedRange as a Range.

Public methods

RangeKt.and

@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<T>> RangeKt.and(Range<T> receiver, Range<T> other)

Return the intersection of this range and other.

Throws
kotlin.IllegalArgumentException

if this is disjoint from other.

RangeKt.plus

@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<T>> RangeKt.plus(Range<T> receiver, T value)

Return the smallest range that includes this and value.

RangeKt.plus

@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<T>> RangeKt.plus(Range<T> receiver, Range<T> other)

Return the smallest range that includes this and other.

RangeKt.rangeTo

@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<T>> RangeKt.rangeTo(T receiver, T that)

Creates a range from this Comparable value to that.

Throws
kotlin.IllegalArgumentException

if this value is comparatively smaller than that.

RangeKt.toClosedRange

@RequiresApi(value = 21)
public static final @NonNull ClosedRange<@NonNull T> <T extends Comparable<T>> RangeKt.toClosedRange(Range<T> receiver)

Returns this Range as a ClosedRange.

RangeKt.toRange

@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<T>> RangeKt.toRange(ClosedRange<T> receiver)

Returns this ClosedRange as a Range.