public class ParsePosition
extends java.lang.Object
implements java.io.Serializable
Scanner
. This is immutable position data, so represents a
point-in-time during the scanning process.Constructor and Description |
---|
ParsePosition(long position,
long column,
long line,
char lastCharacter)
Create a new ParsePosition with the given location information.
|
Modifier and Type | Method and Description |
---|---|
long |
getColumn()
Get the column position for the location in the parsed stream.
|
char |
getLastCharacter()
Get the most recent character parsed by the scanner.
|
long |
getLine()
Get the line position for the location in the parsed stream.
|
long |
getPosition()
Get the absolute position relative to the start of the parsed stream.
|
java.lang.String |
getPositionDetails()
Get a String representation of the parse position.
|
java.lang.String |
toString()
Returns a string representation of the parse position.
|
public ParsePosition(long position, long column, long line, char lastCharacter)
position
- the absolute positioncolumn
- the column positionline
- the line positionlastCharacter
- the most recent characterpublic long getPosition()
public long getColumn()
public long getLine()
public char getLastCharacter()
public java.lang.String getPositionDetails()
public java.lang.String toString()
toString
in class java.lang.Object