public class TextRange internal constructor(private val packedValue: Long)
An immutable text range class, represents a text range from start (inclusive) to end (exclusive). end can be smaller than start and in those cases min and max can be used in order to fetch the values.
Properties
start
public val start: Int
end
public val end: Int
min
public val min: Int
The minimum offset of the range.
max
public val max: Int
The maximum offset of the range.
collapsed
public val collapsed: Boolean
Returns true if the range is collapsed
reversed
public val reversed: Boolean
Returns true if the start offset is larger than the end offset.
length
public val length: Int
Returns the length of the range.
Functions
intersects
public fun intersects(other: TextRange): Boolean
Returns true if the given range has intersection with this range
contains
public operator fun contains(other: TextRange): Boolean
Returns true if this range covers including equals with the given range.
contains
public operator fun contains(offset: Int): Boolean
Returns true if the given offset is a part of this range.
Members
Companion
public companion object
Properties
Zero
public val Zero: TextRange = TextRange(0)