org.eclipse.emf.facet.efacet.core.query
Interface IQueryEvaluator


public interface IQueryEvaluator

This interface is the EMF Facet QueryEvaluator for query evaluation


Method Summary
 java.lang.Object basicEvaluate(Query query, EObject context, java.util.List<ParameterValue> parameterValues)
          This method must be implemented by each sub class to evaluate a query
 void endEvaluate()
          Called when ending the evaluation of a query on one or several context elements.
 boolean getCheckResultType()
          Return whether to check the query result after its evaluation
 void startEvaluate()
          Called when starting the evaluation of a query on one or several context elements (when AbstractQueryEvaluator#evaluate(ModelQueryContext, List) is called).
 

Method Detail

basicEvaluate

java.lang.Object basicEvaluate(Query query,
                               EObject context,
                               java.util.List<ParameterValue> parameterValues)
                               throws QueryException
This method must be implemented by each sub class to evaluate a query

Parameters:
query - The query to evaluate
context - The model element on which the query is evaluated
parameterValues - The query parameter values, can be null
Returns:
A list of QueryResults (one per evaluation)
Throws:
QueryExecutionException
QueryException

getCheckResultType

boolean getCheckResultType()
Return whether to check the query result after its evaluation

Returns:
whether to check the query result after its evaluation

startEvaluate

void startEvaluate()
Called when starting the evaluation of a query on one or several context elements (when AbstractQueryEvaluator#evaluate(ModelQueryContext, List) is called).

A subclass will receive in order:

 startEvaluate()
 basicEvaluate(context1, parameters)
 basicEvaluate(context2, parameters)
 ...
 basicEvaluate(contextn, parameters)
 endEvaluate()
 

When evaluating a query on several context elements, basicEvaluate is called repeatedly with each context element. For some implementations that make use of a system with which you must establish a connection (e.g. a database) for each call, this is costly. The methods startEvaluate and endEvaluate satisfy this requirement

See Also:
AbstractQueryEvaluator#endEvaluate()}

endEvaluate

void endEvaluate()
Called when ending the evaluation of a query on one or several context elements.

A subclass will receive in order:

 startEvaluate()
 basicEvaluate(context1, parameters)
 basicEvaluate(context2, parameters)
 ...
 basicEvaluate(contextn, parameters)
 endEvaluate()
 

When evaluating a query on several context elements, basicEvaluate is called repeatedly with each context element. For some implementations that make use of a system with which you must establish a connection (e.g. a database) for each call, this is costly. The methods startEvaluate and endEvaluate satisfy this requirement

See Also:
AbstractQueryEvaluator#startEvaluate()}