01: /*******************************************************************************
02: * Copyright (c) 2003 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.core.indexsearch;
11:
12: import org.eclipse.core.resources.IResource;
13: import org.eclipse.core.runtime.CoreException;
14:
15: /**
16: * A <code>ISearchResultCollector</code> collects search results from a <code>search</code>
17: * query to a <code>SearchEngine</code>. Clients must implement this interface and pass
18: * an instance to the <code>search(...)</code> methods.
19: * <p>
20: * The order of the results is unspecified. Clients must not rely on this order to display results,
21: * but they should sort these results.
22: * <p>
23: * Clients may implement this interface.
24: * </p>
25: *
26: * @see SearchEngine#search
27: */
28: public interface ISearchResultCollector {
29:
30: /**
31: * Accepts the given search result.
32: *
33: * @param resource the resource in which the match has been found
34: * @param start the start position of the match, -1 if it is unknown
35: * @param length the length of the match
36: * @exception CoreException if this collector had a problem accepting the search result
37: */
38: public void accept(IResource resource, int start, int length)
39: throws CoreException;
40: }
|