Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e0a6413d3bb528a19272683b673c73ac99575c91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/******************************************************************************* 
* Copyright (c) 2009, 2010 EclipseSource and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*   EclipseSource - initial API and implementation
******************************************************************************/
package org.eclipse.equinox.p2.query;

/**
 * A query in which the elements can be evaluated by calling isMatch on. Each
 * element can be evaluated independently of all other elements.  Match queries
 * can be evaluated in parallel as each call {@link #isMatch(Object)} is mutually
 * exclusive from all other calls. <P>
 * 
 * @noimplement This interface is not intended to be implemented by clients. Clients
 * creating custom queries must extend {@link ExpressionMatchQuery}.
 * @deprecated If possible, use one of the predefined queries in {@link QueryUtil} or 
 * use the {@link QueryUtil#createMatchQuery(String, Object...)}
 * to create a custom expression based query. If the query cannot be expressed using
 * the p2QL, then use a predefined or custom expression query as a first filter
 * (in worst case, use {@link QueryUtil#createIUAnyQuery()}) and then provide further filtering
 * like so:<pre>
 * for(iter = queryable.query(someExpressionQuery).iterator(); iter.hasNext();) {
 *   // do your match here
 * }</pre>
 * @since 2.0
 */
public interface IMatchQuery<T> extends IQuery<T> {

	/**
	 * Returns whether the given object satisfies the parameters of this query.
	 * 
	 * @param candidate The object to perform the query against
	 * @return <code>true</code> if the unit satisfies the parameters
	 * of this query, and <code>false</code> otherwise
	 * 
	 * @noreference This method is not intended to be referenced by clients.
	 */
	public boolean isMatch(T candidate);
}

Back to the top