Package com.google.gwt.core.ext.soyc
Class Range
java.lang.Object
com.google.gwt.core.ext.soyc.Range
Represents a contiguous region of characters in the compiler output.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator
<Range> Sorts Ranges so that a Range will be preceded by any Ranges that enclose it.(package private) final int
(package private) final int
(package private) final int
static final Comparator
<Range> Sorts Ranges into the order in which they would appear in the source code based on start position and end position.(package private) final com.google.gwt.dev.jjs.SourceInfo
(package private) final int
(package private) final int
(package private) final int
-
Constructor Summary
ConstructorDescriptionRange
(int start, int end) Constructor.Range
(int start, int end, int startLine, int startColumn, int endLine, int endColumn, com.google.gwt.dev.jjs.SourceInfo sourceInfo) A range whose start and end are specified both as character positions and as line numbers and columns.Range
(int start, int end, com.google.gwt.dev.jjs.SourceInfo sourceInfo) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returntrue
if the given Range lies wholly within the Range.createNormalizedCopy
(int baseStart, int baseStartLine) Creates a Range copy whose start position and line number have been rebased relative to some base position.createOffsetCopy
(int positionOffset, int lineOffset) Creates a Range copy whose start position and line number have been moved by some known offset size.boolean
int
getEnd()
int
int
com.google.gwt.dev.jjs.SourceInfo
int
getStart()
int
int
int
hashCode()
int
length()
toString()
For debugging use only.withNewEnd
(int newEnd, int newEndLine, int newEndColumn) Returns a copy with the end moved.
-
Field Details
-
DEPENDENCY_ORDER_COMPARATOR
Sorts Ranges so that a Range will be preceded by any Ranges that enclose it. -
SOURCE_ORDER_COMPARATOR
Sorts Ranges into the order in which they would appear in the source code based on start position and end position. -
end
final int end -
endColumn
final int endColumn -
endLine
final int endLine -
start
final int start -
startColumn
final int startColumn -
startLine
final int startLine -
sourceInfo
final com.google.gwt.dev.jjs.SourceInfo sourceInfo
-
-
Constructor Details
-
Range
public Range(int start, int end) Constructor.- Parameters:
start
- must be non-negativeend
- must be greater than or equal tostart
-
Range
public Range(int start, int end, com.google.gwt.dev.jjs.SourceInfo sourceInfo) Constructor.- Parameters:
start
- must be non-negativeend
- must be greater than or equal tostart
-
Range
public Range(int start, int end, int startLine, int startColumn, int endLine, int endColumn, com.google.gwt.dev.jjs.SourceInfo sourceInfo) A range whose start and end are specified both as character positions and as line numbers and columns. Everything is zero-based (similar to Java arrays). The ending position must be greater or equal to the starting position.- Parameters:
start
- must be non-negativeend
- must be greater than or equal tostart
-
-
Method Details
-
contains
Returntrue
if the given Range lies wholly within the Range. -
createNormalizedCopy
Creates a Range copy whose start position and line number have been rebased relative to some base position.For example a range that starts at byte 5342 when normalized against a base start of 5000 will now start at byte 342.
-
createOffsetCopy
Creates a Range copy whose start position and line number have been moved by some known offset size.For example a range that starts at byte 342 when moved by an offset of 5000 will now start at byte 5342.
-
equals
-
getEnd
public int getEnd() -
getEndColumn
public int getEndColumn() -
getEndLine
public int getEndLine() -
getSourceInfo
public com.google.gwt.dev.jjs.SourceInfo getSourceInfo() -
getStart
public int getStart() -
getStartColumn
public int getStartColumn() -
getStartLine
public int getStartLine() -
hashCode
public int hashCode() -
length
public int length() -
toString
For debugging use only. -
withNewEnd
Returns a copy with the end moved.
-