Package io.debezium.text
Class Position
- java.lang.Object
-
- io.debezium.text.Position
-
@Immutable public final class Position extends Object
A class that represents the position of a particular character in terms of the lines and columns of a character sequence.- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description private int
column
static Position
EMPTY_CONTENT_POSITION
The position is used when there is no content.private int
indexInContent
private int
line
-
Constructor Summary
Constructors Constructor Description Position(int indexInContent, int line, int column)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
add(Position position)
Return a new position that is the addition of this position and that supplied.int
column()
Get the 1-based column number of the character.boolean
equals(Object obj)
int
hashCode()
int
index()
Get the 0-based index of this position in the content character array.int
line()
Get the 1-based line number of the character.String
toString()
-
-
-
Field Detail
-
EMPTY_CONTENT_POSITION
public static final Position EMPTY_CONTENT_POSITION
The position is used when there is no content.
-
line
private final int line
-
column
private final int column
-
indexInContent
private final int indexInContent
-
-
Method Detail
-
index
public int index()
Get the 0-based index of this position in the content character array.- Returns:
- the index; never negative except for the first position in an empty content.
-
column
public int column()
Get the 1-based column number of the character.- Returns:
- the column number; always positive
-
line
public int line()
Get the 1-based line number of the character.- Returns:
- the line number; always positive
-
-