Number of bits used to encode the column number
Mask to decode the column number
Number of bits used to encode the line number
Mask to decode the line number
Returns the column number of the encoded position.
Encodes a position into a single integer.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
Returns the line number of the encoded position.
Returns a string representation of the encoded position.
The object Position provides convenience methods to encode line and column number in one single integer. The encoded line (column) numbers range from 0 to
LINE_MASK
(COLUMN_MASK
), where0
indicates that the line (column) is undefined and1
represents the first line (column).Line (Column) numbers greater than
LINE_MASK
(COLUMN_MASK
) are replaced byLINE_MASK
(COLUMN_MASK
). Furthermore, if the encoded line number isLINE_MASK
, the column number is always set to 0.The following properties hold:
the undefined position is 0:
encode(0,0) == 0
encodings are non-negative :encode(line,column) >= 0
position order is preserved:implies
(Since version 2.10.0) This class will be removed.