if (col instanceof List)
return evaluateAnd(new DefaultVariable(context, ((List)col).get(0)));
// fall through
default:
IteratePool iter= new IteratePool(context, col.iterator());
EvaluationResult result= fOperator == AND ? EvaluationResult.TRUE : EvaluationResult.FALSE;
while (iter.hasNext()) {
iter.next();
switch(fOperator) {
case OR:
result= result.or(evaluateAnd(iter));
if (result == EvaluationResult.TRUE)
return result;
break;
case AND:
result= result.and(evaluateAnd(iter));
if (result != EvaluationResult.TRUE)
return result;
break;
}
}
return result;
}
} else {
IIterable iterable= Expressions.getAsIIterable(var, this);
if (iterable == null)
return EvaluationResult.NOT_LOADED;
int count= 0;
IteratePool iter= new IteratePool(context, iterable.iterator());
EvaluationResult result= fOperator == AND ? EvaluationResult.TRUE : EvaluationResult.FALSE;
while (iter.hasNext()) {
iter.next();
count++;
switch(fOperator) {
case OR:
result= result.or(evaluateAnd(iter));
if (result == EvaluationResult.TRUE)
return result;
break;
case AND:
result= result.and(evaluateAnd(iter));
if (result != EvaluationResult.TRUE)
return result;
break;
}
}