| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2010 Cloudsmith Inc. and others. |
| 3 |
* |
| 4 |
* This program and the accompanying materials |
| 5 |
* are made available under the terms of the Eclipse Public License 2.0 |
| 6 |
* which accompanies this distribution, and is available at |
| 7 |
* https://www.eclipse.org/legal/epl-2.0/ |
| 8 |
* |
| 9 |
* SPDX-License-Identifier: EPL-2.0 |
| 10 |
* |
| 11 |
* Contributors: |
| 12 |
* Cloudsmith Inc. - initial API and implementation |
| 13 |
*******************************************************************************/ |
| 14 |
package org.eclipse.equinox.p2.metadata.index; |
| 15 |
|
| 16 |
import org.eclipse.equinox.p2.query.IQuery; |
| 17 |
import org.eclipse.equinox.p2.query.IQueryResult; |
| 18 |
|
| 19 |
/** |
| 20 |
* An extension of the {@link IQuery} that allows use of indexes. |
| 21 |
* @since 2.0 |
| 22 |
*/ |
| 23 |
public interface IQueryWithIndex<T> extends IQuery<T> { |
| 24 |
/** |
| 25 |
* Evaluates the query using the <code>indexProvider</code>. The query |
| 26 |
* is first analyzed for index candidates (typically expressions like |
| 27 |
* id == <some value>) and if possible, indexes returned by |
| 28 |
* {@link IIndexProvider#getIndex(String)} will be used |
| 29 |
* in place of the iterator returned by {@link IIndexProvider#everything()}. |
| 30 |
* |
| 31 |
* @param indexProvider The provider of the material to evaluate the query on |
| 32 |
* @return The results of the query. |
| 33 |
*/ |
| 34 |
IQueryResult<T> perform(IIndexProvider<T> indexProvider); |
| 35 |
} |