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
external val character: Int

The zero-based character value.

Link copied to clipboard
external val line: Int

The zero-based line value.

Functions

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

Compare this to other.

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

Check if this position is after other.

Link copied to clipboard
external fun isAfterOrEqual(other: Position): Boolean

Check if this position is after or equal to other.

Link copied to clipboard
external fun isBefore(other: Position): Boolean

Check if this position is before other.

Link copied to clipboard
external fun isBeforeOrEqual(other: Position): Boolean

Check if this position is before or equal to other.

Link copied to clipboard
external 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.

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

Create a new position relative to this position.

Link copied to clipboard
external fun with(change: Position.WithChange): Position

Derived a new position from this position.

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

Create a new position derived from this position.