public class SourceLocation extends Object implements ISourceLocation
UNKNOWN
Constructor and Description |
---|
SourceLocation()
Constructor for an unknown source location.
|
SourceLocation(ISourceLocation location)
Copy Constructor for a known source location.
|
SourceLocation(String sourcePath,
int start,
int end,
int line,
int column)
Constructor for a known source location.
|
Modifier and Type | Method and Description |
---|---|
int |
getAbsoluteEnd()
Gets the absolute starting offset.
|
int |
getAbsoluteStart()
Gets the absolute starting offset.
|
int |
getColumn()
Get the column number where this node starts.
|
int |
getEnd()
Gets the local ending offset.
|
int |
getEndColumn()
Get the column number where this node ends.
|
int |
getEndLine()
Get the line number where this node ends.
|
int |
getLine()
Get the line number where this node starts.
|
protected String |
getLineColumnString()
Displays Line and Column numbers
|
protected String |
getOffsetsString()
Displays line, column, start, end
|
String |
getSourcePath()
Get the source path for this node.
|
protected String |
getSourcePathString()
Displays sourcepath
|
int |
getStart()
Gets the local starting offset.
|
void |
setColumn(int column)
Set the column number where this node starts.
|
void |
setEnd(int end)
Set the absolute offset where this node ends.
|
void |
setEndColumn(int column)
Set the column number where this node ends.
|
void |
setEndLine(int line)
Set the line number where this node ends.
|
void |
setLine(int line)
Set the line number where this node starts.
|
void |
setSourceLocation(ISourceLocation src)
Copies source location information from another instance
into this instance.
|
void |
setSourcePath(String sourcePath)
Set the source path of the node.
|
void |
setStart(int start)
Set the absolute offset where this node starts.
|
void |
span(ISourceLocation location)
Span the location range from
start to end . |
void |
span(ISourceLocation start,
ISourceLocation end)
Span the location range from
start to end . |
String |
toString()
Displays line, column, start, end, and sourcepath in a format such as
"17:5 160-188 C:\test.as"
|
public SourceLocation(String sourcePath, int start, int end, int line, int column)
public SourceLocation(ISourceLocation location)
public SourceLocation()
public final void setSourceLocation(ISourceLocation src)
public int getStart()
ISourceLocation
getStart
in interface ISourceLocation
public int getAbsoluteStart()
ISourceLocation
getAbsoluteStart
in interface ISourceLocation
public int getAbsoluteEnd()
ISourceLocation
getAbsoluteEnd
in interface ISourceLocation
public void setStart(int start)
public int getEnd()
ISourceLocation
getEnd
in interface ISourceLocation
public void setEnd(int end)
public int getLine()
getLine
in interface ISourceLocation
public void setLine(int line)
line
- The line numberpublic int getColumn()
getColumn
in interface ISourceLocation
public void setColumn(int column)
column
- The column numberpublic int getEndLine()
getEndLine
in interface ISourceLocation
public void setEndLine(int line)
line
- The line numberpublic int getEndColumn()
getEndColumn
in interface ISourceLocation
public void setEndColumn(int column)
column
- The column numberpublic final String getSourcePath()
getSourcePath
in interface ISourceLocation
public final void setSourcePath(String sourcePath)
sourcePath
- The source pathpublic String toString()
"17:5 160-188 C:\test.as"
protected String getLineColumnString()
protected String getSourcePathString()
protected String getOffsetsString()
public final void span(ISourceLocation start, ISourceLocation end)
start
to end
.start
- Start location.end
- End location.public final void span(ISourceLocation location)
start
to end
.location
- The locationCopyright © 2016 The Apache Software Foundation. All rights reserved.