W3cubDocs

/Kotlin

ClosedRange

interface ClosedRange<T : Comparable<T>>

Represents a range of values (for example, numbers or characters). See the Kotlin language documentation for more information.

Properties

endInclusive

abstract val endInclusive: T

The maximum value in the range (inclusive).

start

abstract val start: T

The minimum value in the range.

Functions

contains

open operator fun contains(value: T): Boolean

Checks whether the specified value belongs to the range.

isEmpty

open fun isEmpty(): Boolean

Checks whether the range is empty.

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

contains

operator fun ClosedRange<Int>.contains(value: Byte): Boolean
operator fun ClosedRange<Long>.contains(value: Byte): Boolean
operator fun ClosedRange<Short>.contains(
    value: Byte
): Boolean
operator fun ClosedRange<Double>.contains(
    value: Byte
): Boolean
operator fun ClosedRange<Float>.contains(
    value: Byte
): Boolean
operator fun ClosedRange<Int>.contains(
    value: Double
): Boolean
operator fun ClosedRange<Long>.contains(
    value: Double
): Boolean
operator fun ClosedRange<Byte>.contains(
    value: Double
): Boolean
operator fun ClosedRange<Short>.contains(
    value: Double
): Boolean
operator fun ClosedRange<Float>.contains(
    value: Double
): Boolean
operator fun ClosedRange<Int>.contains(value: Float): Boolean
operator fun ClosedRange<Long>.contains(
    value: Float
): Boolean
operator fun ClosedRange<Byte>.contains(
    value: Float
): Boolean
operator fun ClosedRange<Short>.contains(
    value: Float
): Boolean
operator fun ClosedRange<Double>.contains(
    value: Float
): Boolean
operator fun ClosedRange<Long>.contains(value: Int): Boolean
operator fun ClosedRange<Byte>.contains(value: Int): Boolean
operator fun ClosedRange<Short>.contains(value: Int): Boolean
operator fun ClosedRange<Double>.contains(
    value: Int
): Boolean
operator fun ClosedRange<Float>.contains(value: Int): Boolean
operator fun ClosedRange<Int>.contains(value: Long): Boolean
operator fun ClosedRange<Byte>.contains(value: Long): Boolean
operator fun ClosedRange<Short>.contains(
    value: Long
): Boolean
operator fun ClosedRange<Double>.contains(
    value: Long
): Boolean
operator fun ClosedRange<Float>.contains(
    value: Long
): Boolean
operator fun ClosedRange<Int>.contains(value: Short): Boolean
operator fun ClosedRange<Long>.contains(
    value: Short
): Boolean
operator fun ClosedRange<Byte>.contains(
    value: Short
): Boolean
operator fun ClosedRange<Double>.contains(
    value: Short
): Boolean
operator fun ClosedRange<Float>.contains(
    value: Short
): Boolean

Checks if the specified value belongs to this range.

Inheritors

CharRange

class CharRange : CharProgression, ClosedRange<Char>

A range of values of type Char.

ClosedFloatingPointRange

interface ClosedFloatingPointRange<T : Comparable<T>> : 
    ClosedRange<T>

Represents a range of floating point numbers. Extends ClosedRange interface providing custom operation lessThanOrEquals for comparing values of range domain type.

IntRange

class IntRange : IntProgression, ClosedRange<Int>

A range of values of type Int.

LongRange

class LongRange : LongProgression, ClosedRange<Long>

A range of values of type Long.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.ranges/-closed-range/