Package org.aspectj.org.eclipse.jdt.core
Klasse SourceRange
java.lang.Object
org.aspectj.org.eclipse.jdt.core.SourceRange
- Alle implementierten Schnittstellen:
ISourceRange
A source range defines an element's source coordinates relative to
its source buffer.
- Seit:
- 3.6
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSourceRange(int offset, int length) Instantiate a new source range using the given offset and the given length. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanintReturns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.intReturns 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.inthashCode()static booleanisAvailable(ISourceRange range) Helper method that answers whether a valid source range is available in the given ISourceRange.toString()
-
Konstruktordetails
-
SourceRange
public SourceRange(int offset, int length) Instantiate a new source range using the given offset and the given length.- Parameter:
offset- the given offsetlength- the given length
-
-
Methodendetails
-
isAvailable
Helper method that answers whether a valid source range is available in the given ISourceRange. When an element has no associated source code, Java Model APIs may return eithernullor a range of [-1, 0] to indicate an invalid range. This utility method can be used to detect that case.- Parameter:
range- a source range, can benull- Gibt zurück:
trueiff range is not null and range.getOffset() is not -1
-
equals
-
getLength
public int getLength()Beschreibung aus Schnittstelle kopiert:ISourceRangeReturns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.- Angegeben von:
getLengthin SchnittstelleISourceRange- Gibt zurück:
- the number of characters of the source code for this element, relative to the source buffer in which this element is contained
- Siehe auch:
-
getOffset
public int getOffset()Beschreibung aus Schnittstelle kopiert:ISourceRangeReturns 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. However, if the element has no associated source code, an implementation may return -1.- Angegeben von:
getOffsetin SchnittstelleISourceRange- Gibt zurück:
- 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. However, if the element has no associated source code, an implementation may return -1.
- Siehe auch:
-
hashCode
public int hashCode() -
toString
-