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
KonstruktorBeschreibungSourceRange
(int offset, int length) Instantiate a new source range using the given offset and the given length. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
int
Returns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.int
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.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 eithernull
or 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:
true
iff range is not null and range.getOffset() is not -1
-
equals
-
getLength
public int getLength()Beschreibung aus Schnittstelle kopiert:ISourceRange
Returns the number of characters of the source code for this element, relative to the source buffer in which this element is contained.- Angegeben von:
getLength
in 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:ISourceRange
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. However, if the element has no associated source code, an implementation may return -1.- Angegeben von:
getOffset
in 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
-