1 10 package mondrian.calc.impl; 11 12 import mondrian.olap.Evaluator; 13 import mondrian.olap.Exp; 14 import mondrian.olap.type.SetType; 15 import mondrian.calc.IterCalc; 16 import mondrian.calc.Calc; 17 import mondrian.calc.ExpCompiler; 18 19 import java.util.List ; 20 21 32 33 public abstract class AbstractIterCalc 34 extends AbstractCalc 35 implements IterCalc { 36 private final Calc[] calcs; 37 38 46 protected AbstractIterCalc(Exp exp, Calc[] calcs) { 47 super(exp); 48 this.calcs = calcs; 49 assert getType() instanceof SetType : "expecting a set: " + getType(); 50 } 51 52 public Object evaluate(Evaluator evaluator) { 53 final Iterable iter = evaluateIterable(evaluator); 54 return iter; 55 } 56 57 public Calc[] getCalcs() { 58 return calcs; 59 } 60 61 public ExpCompiler.ResultStyle getResultStyle() { 62 return ExpCompiler.ResultStyle.ITERABLE; 63 } 64 } 65 66 | Popular Tags |