Package org.eclipse.jdt.core.search
Interface IJavaSearchResultCollector
-
public interface IJavaSearchResultCollector
Deprecated.Since 3.0, the classSearchRequestor
replaces this interface.AIJavaSearchResultCollector
collects search results from asearch
query to aSearchEngine
. Clients must implement this interface and pass an instance to thesearch(...)
methods. When a search starts, theaboutToStart()
method is called, then 0 or more call toaccept(...)
are done, finally thedone()
method is called.Results provided to this collector may be accurate - in this case they have an
EXACT_MATCH
accuracy - or they might be potential matches only - they have aPOTENTIAL_MATCH
accuracy. This last case can occur when a problem prevented theSearchEngine
from resolving the match.The order of the results is unspecified. Clients must not rely on this order to display results, but they should sort these results (for example, in syntactical order).
The
IJavaSearchResultCollector
is also used to provide a progress monitor to theSearchEngine
.Clients may implement this interface.
- See Also:
SearchEngine
-
-
Field Summary
Fields Modifier and Type Field Description static int
EXACT_MATCH
Deprecated.UseSearchMatch.A_ACCURATE
instead.static int
POTENTIAL_MATCH
Deprecated.UseSearchMatch.A_INACCURATE
instead.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
aboutToStart()
Deprecated.Replaced bySearchRequestor.beginReporting()
.void
accept(IResource resource, int start, int end, IJavaElement enclosingElement, int accuracy)
Deprecated.Replaced bySearchRequestor.acceptSearchMatch(SearchMatch)
.void
done()
Deprecated.Replaced bySearchRequestor.endReporting()
.IProgressMonitor
getProgressMonitor()
Deprecated.Returns the progress monitor used to report progress.
-
-
-
Field Detail
-
EXACT_MATCH
static final int EXACT_MATCH
Deprecated.UseSearchMatch.A_ACCURATE
instead.The search result corresponds exactly to the search pattern.- See Also:
- Constant Field Values
-
POTENTIAL_MATCH
static final int POTENTIAL_MATCH
Deprecated.UseSearchMatch.A_INACCURATE
instead.The search result is potentially a match for the search pattern, but a problem prevented the search engine from being more accurate (typically because of the classpath was not correctly set).- See Also:
- Constant Field Values
-
-
Method Detail
-
aboutToStart
void aboutToStart()
Deprecated.Replaced bySearchRequestor.beginReporting()
.Called before the actual search starts.
-
accept
void accept(IResource resource, int start, int end, IJavaElement enclosingElement, int accuracy) throws CoreException
Deprecated.Replaced bySearchRequestor.acceptSearchMatch(SearchMatch)
.Accepts the given search result.- Parameters:
resource
- the resource in which the match has been foundstart
- the start position of the match, -1 if it is unknownend
- the end position of the match, -1 if it is unknown; the ending offset is exclusive, meaning that the actual range of characters covered is[start, end]
enclosingElement
- the Java element that contains the character range[start, end]
; the value can benull
indicating that no enclosing Java element has been foundaccuracy
- the level of accuracy the search result has; eitherEXACT_MATCH
orPOTENTIAL_MATCH
- Throws:
CoreException
- if this collector had a problem accepting the search result
-
done
void done()
Deprecated.Replaced bySearchRequestor.endReporting()
.Called when the search has ended.
-
getProgressMonitor
IProgressMonitor getProgressMonitor()
Deprecated.Returns the progress monitor used to report progress.- Returns:
- a progress monitor or null if no progress monitor is provided
-
-