public class ExpressionMatchQuery<T> extends Object implements IMatchQuery<T>, IQueryWithIndex<T>
Constructor and Description |
---|
ExpressionMatchQuery(Class<? extends T> matchingClass,
IExpression expression,
Object... parameters) |
ExpressionMatchQuery(Class<? extends T> matchingClass,
String expression,
Object... parameters) |
Modifier and Type | Method and Description |
---|---|
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) |
public ExpressionMatchQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters)
public IEvaluationContext getContext()
public IQueryResult<T> perform(IIndexProvider<T> indexProvider)
IQueryWithIndex
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()
.perform
in interface IQueryWithIndex<T>
indexProvider
- The provider of the material to evaluate the query onpublic IQueryResult<T> perform(Iterator<T> iterator)
IQuery
public boolean isMatch(T candidate)
IMatchQuery
isMatch
in interface IMatchQuery<T>
candidate
- The object to perform the query againsttrue
if the unit satisfies the parameters
of this query, and false
otherwisepublic IMatchExpression<T> getExpression()
IQuery
null
if
this is not an expression query.getExpression
in interface IQuery<T>
null
.public void setIndexProvider(IIndexProvider<T> indexProvider)
public void prePerform()
public void postPerform()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.