@Override public SelectResults filterEvaluate(ExecutionContext context,SelectResults intermediateResults,boolean completeExpansionNeeded,@Retained CompiledValue iterOperands,RuntimeIterator[] indpndntItrs,boolean isIntersection,boolean conditioningNeeded,boolean evaluateProjection) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException {
  if (!isDependentOnCurrentScope(context))   return super.filterEvaluate(context,intermediateResults);
  IndexInfo[] idxInfo=getIndexInfo(context);
  Support.Assert(idxInfo != null,"a comparison that is dependent, not indexed, and filter evaluated is not possible");
  if (idxInfo.length == 1) {
    return singleBaseCollectionFilterEvaluate(context,intermediateResults,completeExpansionNeeded,iterOperands,idxInfo[0],indpndntItrs,isIntersection,conditioningNeeded,evaluateProjection);
  }
 else {
    Support.Assert(idxInfo.length == 2,"A Composite CompiledComparison which is filter evaluatable needs to have two indexes");
    return doubleBaseCollectionFilterEvaluate(context,intermediateResults,completeExpansionNeeded,iterOperands,idxInfo,indpndntItrs);
  }
}

@ Override public SelectResults filterEvaluate ( ExecutionContext context , SelectResults intermediateResults , boolean completeExpansionNeeded , @ Retained CompiledValue iterOperands , RuntimeIterator [ ] indpndntItrs , boolean isIntersection , boolean conditioningNeeded , boolean evaluateProjection ) throws FunctionDomainException , TypeMismatchException , NameResolutionException , QueryInvocationTargetException { if ( ! isDependentOnCurrentScope ( context ) ) return super . filterEvaluate ( context , intermediateResults ) ; IndexInfo [ ] idxInfo = getIndexInfo ( context ) ; Support . Assert ( idxInfo != null , "a comparison that is dependent, not indexed, and filter evaluated is not possible" ) ; if ( idxInfo . length == 1 ) { return singleBaseCollectionFilterEvaluate ( context , intermediateResults , completeExpansionNeeded , iterOperands , idxInfo [ 0 ] , indpndntItrs , isIntersection , conditioningNeeded , evaluateProjection ) ; } else { Support . Assert ( idxInfo . length == 2 , "A Composite CompiledComparison which is filter evaluatable needs to have two indexes" ) ; return doubleBaseCollectionFilterEvaluate ( context , intermediateResults , completeExpansionNeeded , iterOperands , idxInfo , indpndntItrs ) ; } }
asif : evaluates as a filter taking advantage of indexes if appropriate . this function has a meaningful implementation only in compiledcomparison & compiledundefined . it is unsupported in other classes . the additional parameters which it takes are a boolean which is used to indicate whether the index result set needs to be expanded to the top level or not . the second is a compiledvalue representing the operands which are only iter evaluatable . the compiledvalue passed will be null except if a groupjunction has only one filter evaluatable condition & rest are iter operands . in such cases , the iter operands will be evaluated while expanding / cutting down the index resultset
