|
Eclipse JDT Release 3.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.SourceRange
public final class SourceRange
A source range defines an element's source coordinates relative to its source buffer.
ISourceRange
Constructor Summary | |
---|---|
SourceRange(int offset,
int length)
Instantiate a new source range using the given offset and the given length. |
Method Summary | |
---|---|
boolean |
equals(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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SourceRange(int offset, int length)
offset
- the given offsetlength
- the given lengthMethod Detail |
---|
public 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 null
true
iff range is not null and range.getOffset() is not -1public boolean equals(Object obj)
equals
in class Object
public int getLength()
ISourceRange
getLength
in interface ISourceRange
ISourceRange
public int getOffset()
ISourceRange
getOffset
in interface ISourceRange
ISourceRange
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
Eclipse JDT Release 3.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.