Package org.jparsec
Class SourceLocation
- java.lang.Object
-
- org.jparsec.SourceLocation
-
public class SourceLocation extends java.lang.Object
Represents a location inside the source. Not thread safe.- Since:
- 3.1
-
-
Field Summary
Fields Modifier and Type Field Description private int
index
private Location
location
private SourceLocator
locator
-
Constructor Summary
Constructors Constructor Description SourceLocation(int index, SourceLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumn()
Returns the column number of this location.int
getIndex()
Returns the 0-based index within the source.int
getLine()
Returns the line number of this location.private Location
getLocation()
-
-
-
Field Detail
-
index
private final int index
-
locator
private final SourceLocator locator
-
location
private Location location
-
-
Constructor Detail
-
SourceLocation
SourceLocation(int index, SourceLocator locator)
-
-
Method Detail
-
getIndex
public int getIndex()
Returns the 0-based index within the source.
-
getLine
public int getLine()
Returns the line number of this location. Because this method takes amortizedlog(n)
time, it's typically a good idea to avoid calling it until the entire source has been successfully parsed.
-
getColumn
public int getColumn()
Returns the column number of this location. Because this method takes amortizedlog(n)
time, it's typically a good idea to avoid calling it until the entire source has been successfully parsed.
-
getLocation
private Location getLocation()
-
-