RangeKt
public final class RangeKt
Summary
Public methods |
|
|---|---|
static final @NonNull Range<@NonNull T> |
@RequiresApi(value = 21)Return the intersection of this range and |
static final @NonNull Range<@NonNull T> |
@RequiresApi(value = 21)Return the smallest range that includes this and |
static final @NonNull Range<@NonNull T> |
@RequiresApi(value = 21)Return the smallest range that includes this and |
static final @NonNull Range<@NonNull T> |
@RequiresApi(value = 21)Creates a range from this |
static final @NonNull ClosedRange<@NonNull T> |
@RequiresApi(value = 21)Returns this |
static final @NonNull Range<@NonNull T> |
@RequiresApi(value = 21)Returns this |
Public methods
and
@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<@NonNull T>> 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 |
plus
@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<@NonNull T>> plus(
@NonNull Range<@NonNull T> receiver,
@NonNull Range<@NonNull T> other
)
Return the smallest range that includes this and other.
plus
@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<@NonNull T>> plus(
@NonNull Range<@NonNull T> receiver,
@NonNull T value
)
Return the smallest range that includes this and value.
rangeTo
@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<@NonNull T>> 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 |
toClosedRange
@RequiresApi(value = 21)
public static final @NonNull ClosedRange<@NonNull T> <T extends Comparable<@NonNull T>> toClosedRange(@NonNull Range<@NonNull T> receiver)
Returns this Range as a ClosedRange.
toRange
@RequiresApi(value = 21)
public static final @NonNull Range<@NonNull T> <T extends Comparable<@NonNull T>> toRange(@NonNull ClosedRange<@NonNull T> receiver)
Returns this ClosedRange as a Range.