Search in sources :

Example 1 with AndPredicate

use of mondrian.rolap.agg.AndPredicate in project mondrian by pentaho.

the class CompoundPredicateInfo method makeSetPredicate.

private StarPredicate makeSetPredicate(final Exp exp, Evaluator evaluator) {
    TupleIterable evaluatedSet = evaluator.getSetEvaluator(exp, true).evaluateTupleIterable();
    ArrayList<StarPredicate> orList = new ArrayList<StarPredicate>();
    OrPredicate orPredicate = null;
    for (List<Member> complexSetItem : evaluatedSet) {
        List<StarPredicate> andList = new ArrayList<StarPredicate>();
        for (Member singleSetItem : complexSetItem) {
            final List<List<Member>> singleItemList = Collections.singletonList(Collections.singletonList(singleSetItem));
            StarPredicate singlePredicate = predicateFromTupleList(singleItemList, measure, evaluator).getValue();
            andList.add(singlePredicate);
        }
        AndPredicate andPredicate = new AndPredicate(andList);
        orList.add(andPredicate);
        orPredicate = new OrPredicate(orList);
    }
    return orPredicate;
}
Also used : TupleIterable(mondrian.calc.TupleIterable) OrPredicate(mondrian.rolap.agg.OrPredicate) ArrayList(java.util.ArrayList) AndPredicate(mondrian.rolap.agg.AndPredicate) ArrayList(java.util.ArrayList) List(java.util.List) Member(mondrian.olap.Member)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 TupleIterable (mondrian.calc.TupleIterable)1 Member (mondrian.olap.Member)1 AndPredicate (mondrian.rolap.agg.AndPredicate)1 OrPredicate (mondrian.rolap.agg.OrPredicate)1