|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.search.SearchMatch
A search match represents the result of a search query.
Search matches may be accurate (A_ACCURATE
) or they might be
merely potential matches (A_INACCURATE
). The latter occurs when
a compile-time problem prevents the search engine from completely resolving
the match.
This class is intended to be instantiated and subclassed by clients.
SearchEngine.search(SearchPattern, SearchParticipant[], IJavaSearchScope, SearchRequestor, org.eclipse.core.runtime.IProgressMonitor)
Field Summary | |
static int |
A_ACCURATE
The search result corresponds an exact match of the search pattern. |
static int |
A_INACCURATE
The search result is potentially a match for the search pattern, but the search engine is unable to fully check it (for example, because there are errors in the code or the classpath are not correctly set). |
Constructor Summary | |
SearchMatch(IJavaElement element,
int accuracy,
int offset,
int length,
SearchParticipant participant,
IResource resource)
Creates a new search match. |
Method Summary | |
int |
getAccuracy()
Returns the accuracy of this search match. |
Object |
getElement()
Returns the element of this search match. |
int |
getLength()
Returns the length of this search match. |
int |
getOffset()
Returns the offset of this search match. |
SearchParticipant |
getParticipant()
Returns the search participant which issued this search match. |
IResource |
getResource()
Returns the resource containing this search match. |
boolean |
isInsideDocComment()
Returns whether this search match is inside a doc comment of a Java source file. |
void |
setAccuracy(int accuracy)
Sets the accuracy of this match. |
void |
setElement(Object element)
Sets the element of this search match. |
void |
setInsideDocComment(boolean insideDoc)
Sets whether this search match is inside a doc comment of a Java source file. |
void |
setLength(int length)
Sets the length of this search match. |
void |
setOffset(int offset)
Sets the offset of this search match. |
void |
setParticipant(SearchParticipant participant)
Sets the participant of this match. |
void |
setResource(IResource resource)
Sets the resource of this match. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int A_ACCURATE
public static final int A_INACCURATE
Constructor Detail |
public SearchMatch(IJavaElement element, int accuracy, int offset, int length, SearchParticipant participant, IResource resource)
Note that isInsideDocComment()
defaults to false.
element
- the element that encloses or corresponds to the match,
or null
if noneaccuracy
- one of A_ACCURATE
or A_INACCURATE
offset
- the offset the match starts at, or -1 if unknownlength
- the length of the match, or -1 if unknownparticipant
- the search participant that created the matchresource
- the resource of the element, or null
if noneMethod Detail |
public final int getAccuracy()
A_ACCURATE
or A_INACCURATE
public final Object getElement()
null
if nonepublic final int getLength()
public final int getOffset()
public final SearchParticipant getParticipant()
public final IResource getResource()
null
if nonepublic final boolean isInsideDocComment()
true
if this search match is inside a doc
comment, and false
otherwisepublic final void setAccuracy(int accuracy)
accuracy
- one of A_ACCURATE
or A_INACCURATE
public final void setElement(Object element)
element
- the element that encloses or corresponds to the match,
or null
if nonepublic final void setLength(int length)
length
- the length of the match, or -1 if unknownpublic final void setOffset(int offset)
offset
- the offset the match starts at, or -1 if unknownpublic final void setParticipant(SearchParticipant participant)
participant
- the search participant that created this matchpublic final void setResource(IResource resource)
resource
- the resource of the match, or null
if nonepublic final void setInsideDocComment(boolean insideDoc)
insideDoc
- true
if this search match is inside a doc
comment, and false
otherwisepublic String toString()
|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |