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 intcolumnstatic PositionEMPTY_CONTENT_POSITIONThe position is used when there is no content.private intindexInContentprivate intline
-
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 Positionadd(Position position)Return a new position that is the addition of this position and that supplied.intcolumn()Get the 1-based column number of the character.booleanequals(Object obj)inthashCode()intindex()Get the 0-based index of this position in the content character array.intline()Get the 1-based line number of the character.StringtoString()
-
-
-
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
-
-