Package org.eclipse.equinox.p2.query
Class ExpressionMatchQuery<T>
- java.lang.Object
-
- org.eclipse.equinox.p2.query.ExpressionMatchQuery<T>
-
- All Implemented Interfaces:
IQueryWithIndex<T>,IMatchQuery<T>,IQuery<T>
- Direct Known Subclasses:
ArtifactDescriptorQuery,ArtifactKeyQuery,IUProfilePropertyQuery,OSGiBundleQuery
public class ExpressionMatchQuery<T> extends Object implements IMatchQuery<T>, IQueryWithIndex<T>
A query that matches candidates against an expression.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description ExpressionMatchQuery(Class<? extends T> matchingClass, String expression, Object... parameters)ExpressionMatchQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IEvaluationContextgetContext()IMatchExpression<T>getExpression()Returns the IExpression backing this query ornullif this is not an expression query.Class<? extends T>getMatchingClass()booleanisMatch(T candidate)Returns whether the given object satisfies the parameters of this query.IQueryResult<T>perform(Iterator<T> iterator)Evaluates the query for a specific input.IQueryResult<T>perform(IIndexProvider<T> indexProvider)Evaluates the query using theindexProvider.voidpostPerform()voidprePerform()voidsetIndexProvider(IIndexProvider<T> indexProvider)
-
-
-
Method Detail
-
getContext
public IEvaluationContext getContext()
-
perform
public IQueryResult<T> perform(IIndexProvider<T> indexProvider)
Description copied from interface:IQueryWithIndexEvaluates the query using theindexProvider. The query is first analyzed for index candidates (typically expressions like id == <some value>) and if possible, indexes returned byIIndexProvider.getIndex(String)will be used in place of the iterator returned byIIndexProvider.everything().- Specified by:
performin interfaceIQueryWithIndex<T>- Parameters:
indexProvider- The provider of the material to evaluate the query on- Returns:
- The results of the query.
-
perform
public IQueryResult<T> perform(Iterator<T> iterator)
Description copied from interface:IQueryEvaluates the query for a specific input.
-
isMatch
public boolean isMatch(T candidate)
Description copied from interface:IMatchQueryReturns 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
-
getExpression
public IMatchExpression<T> getExpression()
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.
-
setIndexProvider
public void setIndexProvider(IIndexProvider<T> indexProvider)
-
prePerform
public void prePerform()
-
postPerform
public void postPerform()
-
-