public class Extent extends CExtent
They represent a degenerate form of composite extents where no placeholder replacement is required and the extent stands for the contents of a simple character region of a file.
Modifier and Type | Field and Description |
---|---|
static Extent |
DUMMY
A dummy extent for convenience
|
int |
endPos
The offset of the last character in the extent (0-based)
|
String |
filename
The absolute filename where this extent should be interpreted
|
int |
startCol
The column where the extent starts, i.e. the offset
of the starting character from the beginning of the line
(0-based)
|
int |
startLine
The line where the extent starts (1-based)
|
int |
startPos
The starting character offset of the extent (0-based)
|
Constructor and Description |
---|
Extent(String filename,
int startPos,
int endPos,
int startLine,
int startCol)
Returns a new extent described by the given arguments
|
Modifier and Type | Method and Description |
---|---|
int |
endPos() |
boolean |
equals(@Nullable Object obj) |
String |
filename() |
String |
find()
The string must be of length
CExtent.realLength() . |
SourceMapping.Origin |
findOrigin(int offset,
int length)
Finding the origin in a composite extent amounts to finding
the innermost extent, composite or not, whose instantiation
covers the given region.
|
int |
hashCode() |
static Extent |
inlined(String contents) |
int |
length() |
int |
realLength()
The real length of an extent is the actual length
of its representation once all place-holders have been
replaced.
|
int |
startCol() |
int |
startLine() |
int |
startPos() |
String |
toString() |
public final String filename
public final int startPos
public final int endPos
public final int startLine
public final int startCol
public static final Extent DUMMY
public Extent(String filename, int startPos, int endPos, int startLine, int startCol)
filename
- startPos
- endPos
- startLine
- startCol
- public String filename()
public int startPos()
public int endPos()
public int startLine()
public int startCol()
public int length()
public int realLength()
CExtent
It can be different from CExtent.length()
, the length of
the extent as it appeared uninstantiated in the original
source.
realLength
in class CExtent
CExtent.find()
public String find()
CExtent
CExtent.realLength()
.public SourceMapping.Origin findOrigin(int offset, int length)
CExtent
findOrigin
in class CExtent
offset
- relative offset from the start of this extentoffset
and length
SourceMapping.Origin