Position

A position in a source file. Lines and columns start counting at 1.

Constructors

Link copied to clipboard
constructor(line: Int, column: Int)
TODO: Do we refer to the characters as columns, ...or the spaces between (thus also before/after) characters as columns?

Properties

Link copied to clipboard
Line numbers must be positive, thus
Link copied to clipboard
Link copied to clipboard
val column: Int
Link copied to clipboard
val FIRST_COLUMN: Int = 1
The first column -- note that it is 1-indexed (i.e.
Link copied to clipboard
val FIRST_LINE: Int = 1
The first line -- note that it is 1-indexed (i.e.
Link copied to clipboard
The first position in the file.
Link copied to clipboard
val line: Int

Functions

Link copied to clipboard
open fun compareTo(otherPosition: Position): Int
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun invalid(): Boolean
Link copied to clipboard
open fun isAfter(otherPosition: Position): Boolean
Link copied to clipboard
open fun isAfterOrEqual(otherPosition: Position): Boolean
Link copied to clipboard
open fun isBefore(otherPosition: Position): Boolean
Link copied to clipboard
open fun isBeforeOrEqual(otherPosition: Position): Boolean
Link copied to clipboard
open fun nextLine(): Position
Link copied to clipboard
open fun orIfInvalid(alternativePosition: Position): Position
Link copied to clipboard
open fun pos(line: Int, column: Int): Position
Convenient factory method.
Link copied to clipboard
open fun right(characters: Int): Position
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun valid(): Boolean
Check if the position is usable, also checks for special positions (ABSOLUTE_BEGIN_LINE and ABSOLUTE_END_LINE).
Link copied to clipboard
open fun withColumn(column: Int): Position
Link copied to clipboard
open fun withLine(line: Int): Position