RangeKt

public final class RangeKt


Summary

Public methods

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

Return the intersection of this range and other.

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

Return the smallest range that includes this and value.

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

Return the smallest range that includes this and other.

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

Creates a range from this Comparable value to that.

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

Returns this Range as a ClosedRange.

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

Returns this ClosedRange as a Range.

Public methods

RangeKt.and

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

Return the intersection of this range and other.

Throws
kotlin.IllegalArgumentException

if this is disjoint from other.

RangeKt.plus

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

Return the smallest range that includes this and value.

RangeKt.plus

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

Return the smallest range that includes this and other.

RangeKt.rangeTo

@RequiresApi(value = "21")
@NonNull
public static final @RequiresApi(value = "21") Range<@NonNull T> <T extends Comparable<@NonNull T>> RangeKt.rangeTo(
    @NonNull T receiver,
    @NonNull 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")
@NonNull
public static final @RequiresApi(value = "21") ClosedRange<@NonNull T> <T extends Comparable<@NonNull T>> RangeKt.toClosedRange(
    @NonNull Range<@NonNull T> receiver
)

Returns this Range as a ClosedRange.

RangeKt.toRange

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

Returns this ClosedRange as a Range.