Position

open class Position(source)

Represents a line and character position, such as the position of the cursor.

Position objects are immutable. Use the with or translate methods to derive new positions from an existing position.

Online Documentation

Constructors

Link copied to clipboard
constructor(line: Int, character: Int)

Types

Link copied to clipboard
interface TranslateChange
Link copied to clipboard
interface WithChange

Properties

Link copied to clipboard

The zero-based character value.

Link copied to clipboard
val line: Int

The zero-based line value.

Functions

Link copied to clipboard
fun compareTo(other: Position): Int

Compare this to other.

Link copied to clipboard
fun isAfter(other: Position): Boolean

Check if this position is after other.

Link copied to clipboard

Check if this position is after or equal to other.

Link copied to clipboard

Check if this position is before other.

Link copied to clipboard

Check if this position is before or equal to other.

Link copied to clipboard
fun isEqual(other: Position): Boolean

Check if this position is equal to other.

Link copied to clipboard

Derived a new position relative to this position.

fun translate(lineDelta: Int = definedExternally, characterDelta: Int = definedExternally): Position

Create a new position relative to this position.

Link copied to clipboard

Derived a new position from this position.

fun with(line: Int = definedExternally, character: Int = definedExternally): Position

Create a new position derived from this position.