public static class Range.Position
extends java.lang.Object
Parser.setTrackPosition(boolean).Node.sourceRange()| Modifier and Type | Field and Description |
|---|---|
private int |
columnNumber |
private int |
lineNumber |
private int |
pos |
| Constructor and Description |
|---|
Position(int pos,
int lineNumber,
int columnNumber)
Create a new Position object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
columnNumber()
Gets the cursor number (1-based) of the original input source that this Position was read at.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isTracked()
Test if this position was tracked during parsing.
|
int |
lineNumber()
Gets the line number (1-based) of the original input source that this Position was read at.
|
int |
pos()
Gets the position index (0-based) of the original input source that this Position was read at.
|
java.lang.String |
toString()
Gets a String presentation of this Position, in the format
line,column:pos. |
private final int pos
private final int lineNumber
private final int columnNumber
public Position(int pos,
int lineNumber,
int columnNumber)
pos - position indexlineNumber - line numbercolumnNumber - column numberpublic int pos()
-1 if untracked.public int lineNumber()
-1 if untracked.public int columnNumber()
-1 if untracked.public boolean isTracked()
-1).public java.lang.String toString()
line,column:pos.toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object