class IntRange
source · line 5public
public class IntRange internal constructor(
private val first: Int,
private val endpoint: Int,
private val stride: Int,
private val descending: Boolean,
private val inclusive: Boolean
) : Iterable<Int>, Contains<Int>
- Supertype
Iterable<Int> - Supertype
Contains<Int>
An integer progression with a fixed direction, positive step, and inclusive or exclusive endpoint. Iteration checks the endpoint before arithmetic can wrap.
function iterator
source · line 15public
public override operator fun iterator(): Iterator<Int>
- Overrides
iterator· Iterable
Creates a fresh cursor over this progression.
function step
source · line 22public
public infix fun step(value: Int): IntRange
Returns a progression with the requested positive step magnitude, preserving direction and endpoint policy. Zero or negative signed steps are invalid.
parameter value
source · line 22public
value: Int
function contains
source · line 32public
public override operator fun contains(value: Int): Boolean
- Overrides
contains· Contains
Tests membership using both endpoint bounds and alignment with the progression step.
parameter value
source · line 32public
value: Int