public class SearchMatch
extends java.lang.Object
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.
Provisional API: This class/interface is part of an interim API that is still under development and expected to
change significantly before reaching stability. It is being made available at this early stage to solicit feedback
from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
(repeatedly) as the API evolves.| Modifier and Type | Field and Description |
|---|---|
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 includepath are not correctly set).
|
| Constructor and Description |
|---|
SearchMatch(IJavaScriptElement element,
int accuracy,
int offset,
int length,
SearchParticipant participant,
IResource resource)
Creates a new search match.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAccuracy()
Returns the accuracy of this search match.
|
java.lang.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.
|
int |
getRule()
Returns the rule used while creating the match.
|
boolean |
isEquivalent()
Returns whether match element is compatible with searched pattern or not.
|
boolean |
isErasure()
Returns whether match element only has same erasure than searched pattern or not.
|
boolean |
isExact()
Returns whether element matches exactly searched pattern or not.
|
boolean |
isImplicit()
Returns whether the associated element is implicit or not.
|
boolean |
isInsideDocComment()
Returns whether this search match is inside a doc comment of a Java
source file.
|
boolean |
isRaw()
Returns whether the associated element is a raw type/method or not.
|
void |
setAccuracy(int accuracy)
Sets the accuracy of this match.
|
void |
setElement(java.lang.Object element)
Sets the element of this search match.
|
void |
setImplicit(boolean implicit)
Sets whether the associated element is implicit or not.
|
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 |
setRaw(boolean raw)
Set whether the associated element is a raw type/method or not.
|
void |
setResource(IResource resource)
Sets the resource of this match.
|
void |
setRule(int rule)
Set the rule used while reporting the match.
|
java.lang.String |
toString() |
public static final int A_ACCURATE
getAccuracy(),
Constant Field Valuespublic static final int A_INACCURATE
getAccuracy(),
Constant Field Valuespublic SearchMatch(IJavaScriptElement 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_INACCURATEoffset - 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 nonepublic final int getAccuracy()
A_ACCURATE or A_INACCURATEpublic final java.lang.Object getElement()
null if nonepublic final int getLength()
public final int getOffset()
public final SearchParticipant getParticipant()
public final IResource getResource()
null if nonepublic final int getRule()
SearchPattern.R_FULL_MATCH, SearchPattern.R_EQUIVALENT_MATCH
or SearchPattern.R_ERASURE_MATCHpublic final boolean isEquivalent()
true if match element is compatible
false otherwisepublic final boolean isErasure()
true if match element has same erasure
false otherwisepublic final boolean isExact()
true if match is exact
false otherwisepublic final boolean isImplicit()
true if this match is associated to an implicit
element and false otherwisepublic final boolean isRaw()
true if this match is associated to a raw
type or method and false otherwisepublic 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_INACCURATEpublic final void setElement(java.lang.Object element)
element - the element that encloses or corresponds to 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 final void setImplicit(boolean implicit)
implicit - true if this match is associated to an implicit
element and false otherwisepublic 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 setRule(int rule)
rule - one of SearchPattern.R_FULL_MATCH, SearchPattern.R_EQUIVALENT_MATCH
or SearchPattern.R_ERASURE_MATCHpublic final void setRaw(boolean raw)
raw - true if this search match is associated to a raw
type or method and false otherwisepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.