public static class Range.Position extends Object
Parser.setTrackPosition(boolean).Node.sourceRange()| 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(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.
|
String |
toString()
Gets a String presentation of this Position, in the format
line,column:pos. |
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 String toString()
line,column:pos.Copyright © 2009–2022 Jonathan Hedley. All rights reserved.