public final class SourceRange extends java.lang.Object implements ISourceRange
ISourceRange| Constructor and Description |
|---|
SourceRange(int offset,
int length)
Instantiate a new source range using the given offset and the given length.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
getLength()
Returns the number of characters of the source code for this element,
relative to the source buffer in which this element is contained.
|
int |
getOffset()
Returns the 0-based index of the first character of the source code for this element,
relative to the source buffer in which this element is contained.
|
int |
hashCode() |
static boolean |
isAvailable(ISourceRange range)
Helper method that answers whether a valid source range is available
in the given ISourceRange.
|
java.lang.String |
toString() |
public SourceRange(int offset,
int length)
offset - the given offsetlength - the given lengthpublic static boolean isAvailable(ISourceRange range)
null or a range of
[-1, 0] to indicate an invalid range. This utility method can be used
to detect that case.range - a source range, can be nulltrue iff range is not null and range.getOffset() is not -1public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int getLength()
ISourceRangegetLength in interface ISourceRangeISourceRangepublic int getOffset()
ISourceRangegetOffset in interface ISourceRangeISourceRangepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object