private static boolean addToEvaluator(ArrayDeque<FilterValueSetParam> remainingParameters,FilterHandle filterCallback,EventEvaluator eventEvaluator,ArrayDeque<EventTypeIndexBuilderIndexLookupablePair> treePathInfo,FilterServiceGranularLockFactory lockFactory){
  if (eventEvaluator instanceof FilterHandleSetNode) {
    FilterHandleSetNode node=(FilterHandleSetNode)eventEvaluator;
    addToNode(remainingParameters,filterCallback,node,treePathInfo,lockFactory);
    return true;
  }
  FilterParamIndexBase nextIndex=(FilterParamIndexBase)eventEvaluator;
  FilterValueSetParam parameter=IndexHelper.findParameter(remainingParameters,nextIndex);
  if (parameter != null) {
    remainingParameters.remove(parameter);
    treePathInfo.add(new EventTypeIndexBuilderIndexLookupablePair(nextIndex,parameter.getFilterForValue()));
    addToIndex(remainingParameters,filterCallback,nextIndex,parameter.getFilterForValue(),treePathInfo,lockFactory);
    return true;
  }
  return false;
}

private static boolean addToEvaluator ( ArrayDeque < FilterValueSetParam > remainingParameters , FilterHandle filterCallback , EventEvaluator eventEvaluator , ArrayDeque < EventTypeIndexBuilderIndexLookupablePair > treePathInfo , FilterServiceGranularLockFactory lockFactory ) { if ( eventEvaluator instanceof FilterHandleSetNode ) { FilterHandleSetNode node = ( FilterHandleSetNode ) eventEvaluator ; addToNode ( remainingParameters , filterCallback , node , treePathInfo , lockFactory ) ; return true ; } FilterParamIndexBase nextIndex = ( FilterParamIndexBase ) eventEvaluator ; FilterValueSetParam parameter = IndexHelper . findParameter ( remainingParameters , nextIndex ) ; if ( parameter != null ) { remainingParameters . remove ( parameter ) ; treePathInfo . add ( new EventTypeIndexBuilderIndexLookupablePair ( nextIndex , parameter . getFilterForValue ( ) ) ) ; addToIndex ( remainingParameters , filterCallback , nextIndex , parameter . getFilterForValue ( ) , treePathInfo , lockFactory ) ; return true ; } return false ; }
add filter callback to an event evaluator , which could be either an index node or a set node .
