Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.query
Class ExpressionMatchQuery<T>

java.lang.Object
  extended by 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
ExpressionMatchQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters)
           
ExpressionMatchQuery(Class<? extends T> matchingClass, String expression, Object... parameters)
           
 
Method Summary
 IEvaluationContext getContext()
           
 IMatchExpression<T> getExpression()
          Returns the IExpression backing this query or null if this is not an expression query.
 Class<? extends T> getMatchingClass()
           
 boolean isMatch(T candidate)
          Returns whether the given object satisfies the parameters of this query.
 IQueryResult<T> perform(IIndexProvider<T> indexProvider)
          Evaluates the query using the indexProvider.
 IQueryResult<T> perform(Iterator<T> iterator)
          Evaluates the query for a specific input.
 void postPerform()
           
 void prePerform()
           
 void setIndexProvider(IIndexProvider<T> indexProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionMatchQuery

public ExpressionMatchQuery(Class<? extends T> matchingClass,
                            IExpression expression,
                            Object... parameters)

ExpressionMatchQuery

public ExpressionMatchQuery(Class<? extends T> matchingClass,
                            String expression,
                            Object... parameters)
Method Detail

getContext

public IEvaluationContext getContext()

getMatchingClass

public Class<? extends T> getMatchingClass()

perform

public IQueryResult<T> perform(IIndexProvider<T> indexProvider)
Description copied from interface: IQueryWithIndex
Evaluates the query using the indexProvider. The query is first analyzed for index candidates (typically expressions like id == <some value>) and if possible, indexes returned by IIndexProvider.getIndex(String) will be used in place of the iterator returned by IIndexProvider.everything().

Specified by:
perform in interface IQueryWithIndex<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: IQuery
Evaluates the query for a specific input.

Specified by:
perform in interface IQuery<T>
Parameters:
iterator - The elements for which to evaluate the query on
Returns:
The results of the query.

isMatch

public boolean isMatch(T candidate)
Description copied from interface: IMatchQuery
Returns whether the given object satisfies the parameters of this query.

Specified by:
isMatch in interface IMatchQuery<T>
Parameters:
candidate - The object to perform the query against
Returns:
true if the unit satisfies the parameters of this query, and false otherwise

getExpression

public IMatchExpression<T> getExpression()
Description copied from interface: IQuery
Returns the IExpression backing this query or null if this is not an expression query.

Specified by:
getExpression in interface IQuery<T>
Returns:
An expression or null.

setIndexProvider

public void setIndexProvider(IIndexProvider<T> indexProvider)

prePerform

public void prePerform()

postPerform

public void postPerform()

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.