Package org.eclipse.equinox.p2.query
Class MatchQuery<T>
- java.lang.Object
-
- org.eclipse.equinox.p2.query.MatchQuery<T>
-
- All Implemented Interfaces:
IMatchQuery<T>,IQuery<T>
@Deprecated public abstract class MatchQuery<T> extends Object implements IMatchQuery<T>
Deprecated.If possible, use one of the predefined queries inQueryUtilor use theQueryUtil.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, useQueryUtil.createIUAnyQuery()) and then provide further filtering like so:for(iter = queryable.query(someExpressionQuery).iterator(); iter.hasNext();) { // do your match here }This class represents a simple Java-based query. Clients may subclass and override theisMatch(Object)method in order to write simple queries against p2 metadata.Note that hand-written queries cannot be optimized for queryables containing indices, or for remote queryables. In general you should use one of the pre-defined queries found in
QueryUtilif possible, to obtain queries optimized for indexing and remote execution. This class is intended for simple queries against small data sources where indexed lookup and remote query execution are not needed.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description MatchQuery()Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IExpressiongetExpression()Deprecated.Returns the IExpression backing this query ornullif this is not an expression query.abstract booleanisMatch(T candidate)Deprecated.Returns whether the given object satisfies the parameters of this query.IQueryResult<T>perform(Iterator<T> iterator)Deprecated.Performs this query on the given iterator, passing all objects in the iterator that match the criteria of this query to the given result.voidpostPerform()Deprecated.Execute any post-processing that must be done after this query has been performed against a particular iterator.voidprePerform()Deprecated.Execute any pre-processing that must be done before this query is performed against a particular iterator.
-
-
-
Method Detail
-
isMatch
public abstract boolean isMatch(T candidate)
Deprecated.Returns whether the given object satisfies the parameters of this query.- Specified by:
isMatchin interfaceIMatchQuery<T>- Parameters:
candidate- The object to perform the query against- Returns:
trueif the unit satisfies the parameters of this query, andfalseotherwise- Since:
- 2.0
- Restriction:
- This method is not intended to be referenced by clients.
Clients should call
perform(Iterator)
-
perform
public final IQueryResult<T> perform(Iterator<T> iterator)
Deprecated.Performs this query on the given iterator, passing all objects in the iterator that match the criteria of this query to the given result.
-
prePerform
public void prePerform()
Deprecated.Execute any pre-processing that must be done before this query is performed against a particular iterator. This method may be used by subclasses to do any calculations, caching, or other preparation for the query.This method is internal to the framework. Subclasses may override this method, but should not call this method.
- Restriction:
- This method is not intended to be referenced by clients.
-
postPerform
public void postPerform()
Deprecated.Execute any post-processing that must be done after this query has been performed against a particular iterator. This method may be used by subclasses to clear caches or any other cleanup that should occur after a query.This method will be called even if the query does not complete successfully.
This method is internal to the framework. Subclasses may override this method, but should not call this method.
- Restriction:
- This method is not intended to be referenced by clients.
-
getExpression
public IExpression getExpression()
Deprecated.Description copied from interface:IQueryReturns the IExpression backing this query ornullif this is not an expression query.- Specified by:
getExpressionin interfaceIQuery<T>- Returns:
- An expression or
null.
-
-