Position class

Stores a position in a text represented by a line index and a column index.

Constructors

Position(int line, int column, [TextEngine? searchEngine])

Properties

column int
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
line int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchEngine TextEngine?
final

Methods

addColumn(int offset) bool
Adds an offset to the column. If the new column is behind the line end the first position in the next line is set. offset may be negative. Returns true, if next line is set.
backward(int offset) bool
Moves the position offset characters backwards (across lines). Returns false: offset was too large, begin of text is reached.
clone(Position source) → void
Takes the data from another Position instance.
endOfText() → void
Positions to the end of lines.
forward(int offset) bool
Moves the position offset characters forward (across lines). Returns false: offset was too large, end of text is reached
isAbove(Position reference, {bool orEqual = false}) bool
Returns whether the instance is above ("lower than") the reference. If orEquals is true and the positions are equal true will be returned.
isBelow(Position reference, {bool orEqual = false}) bool
Returns whether the instance is below ("greater than") the reference. If orEquals is true and the positions are equal true will be returned.
isEndOfText() bool
Tests whether a given position points to the end of text. Return true: position is end of text.
nextLine([int count = 1]) bool
Moves the position to the start of the next line, count times. If starting from the end of text position remains. Returns true if position is not as required (end of text reached).
normalize() bool
Normalizes "end of line":
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previousLine([int count = 1]) bool
Moves the position to the begin of the previous line count times. Returns true if position is not as required (begin of text reached).
set(int line, int column) → void
Sets the line and the column. lines: if not null the line length is the limit.
setEndOfText() → void
Sets the instance at the first position behind the text given as line list.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited