Examples of AbstractListCalc


Examples of mondrian.calc.impl.AbstractListCalc

    public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
        final Level level = getLevel(compiler.getEvaluator());
        switch (call.getArgCount()) {
        case 0:
            return new AbstractListCalc(call, new Calc[0]) {
                public List evaluateList(Evaluator evaluator) {
                    return periodsToDate(evaluator, level, null);
                }

                public boolean dependsOn(Hierarchy hierarchy) {
                    return hierarchy.getDimension().getDimensionType()
                        == mondrian.olap.DimensionType.TimeDimension;
                }
            };
        default:
            final MemberCalc memberCalc =
                compiler.compileMember(call.getArg(0));
            return new AbstractListCalc(call, new Calc[] {memberCalc}) {
                public List evaluateList(Evaluator evaluator) {
                    return periodsToDate(
                        evaluator, level,
                        memberCalc.evaluateMember(evaluator));
                }
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

    }

    public Calc compileCall(final ResolvedFunCall call, ExpCompiler compiler) {
        final MemberCalc[] memberCalcs =
            compileMembers(call.getArg(0), call.getArg(1), compiler);
        return new AbstractListCalc(
            call, new Calc[] {memberCalcs[0], memberCalcs[1]})
            {
            public List evaluateList(Evaluator evaluator) {
                final Member member0 = memberCalcs[0].evaluateMember(evaluator);
                final Member member1 = memberCalcs[1].evaluateMember(evaluator);
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

            call.getArgCount() > 3
            ? compiler.compileScalar(call.getArg(3), true)
            : new ValueCalc(
                new DummyExp(
                    new ScalarType()));
        return new AbstractListCalc(
            call,
            new Calc[] {listCalc, integerCalc, orderCalc})
        {
            public List evaluateList(Evaluator evaluator) {
                // Use a native evaluator, if more efficient.
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

        final StringCalc stringCalc = compiler.compileString(call.getArg(0));
        SetType type = (SetType) call.getType();
        Type elementType = type.getElementType();
        if (elementType instanceof MemberType) {
            final Hierarchy hierarchy = elementType.getHierarchy();
            return new AbstractListCalc(call, new Calc[] {stringCalc}) {
                public List evaluateList(Evaluator evaluator) {
                    String string = stringCalc.evaluateString(evaluator);
                    if (string == null) {
                        throw newEvalException(
                            MondrianResource.instance().NullValue.ex());
                    }
                    return parseMemberList(evaluator, string, hierarchy);
                }
            };
        } else {
            TupleType tupleType = (TupleType) elementType;
            final Hierarchy[] hierarchies =
                new Hierarchy[tupleType.elementTypes.length];
            for (int i = 0; i < tupleType.elementTypes.length; i++) {
                hierarchies[i] = tupleType.elementTypes[i].getHierarchy();
            }
            return new AbstractListCalc(call, new Calc[] {stringCalc}) {
                public List evaluateList(Evaluator evaluator) {
                    String string = stringCalc.evaluateString(evaluator);
                    if (string == null) {
                        throw newEvalException(
                            MondrianResource.instance().NullValue.ex());
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

            levelCalc == null
            ? ((RolapCube) compiler.getEvaluator().getCube()).getTimeHierarchy(
                getName())
            : null;

        return new AbstractListCalc(call, new Calc[] {levelCalc, memberCalc}) {
            public List evaluateList(Evaluator evaluator) {
                final Member member;
                final Level level;
                if (levelCalc == null) {
                    member = evaluator.getContext(timeHierarchy);
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

            compiler.compileInteger(call.getArg(1));
        final IntegerCalc countCalc =
            call.getArgCount() > 2
            ? compiler.compileInteger(call.getArg(2))
            : null;
        return new AbstractListCalc(
            call, new Calc[] {listCalc, startCalc, countCalc})
        {
            public List evaluateList(Evaluator evaluator) {
                evaluator = evaluator.push(false);
                final List list =
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

    public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
        final ListCalc listCalc1 = compiler.compileList(call.getArg(0));
        final ListCalc listCalc2 = compiler.compileList(call.getArg(1));

        return new AbstractListCalc(call, new Calc[] {listCalc1, listCalc2}) {
            public List evaluateList(Evaluator evaluator) {
                List left = listCalc1.evaluateList(evaluator);
                if (left == null || left.isEmpty()) {
                    return Collections.EMPTY_LIST;
                }
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

        final ListCalc listCalc0 =
            compiler.compileList(call.getArg(0));
        final ListCalc listCalc1 =
            compiler.compileList(call.getArg(1));
        if (((SetType) call.getType()).getArity() == 1) {
            return new AbstractListCalc(call, new Calc[] {listCalc0, listCalc1})
            {
                public List evaluateList(Evaluator evaluator) {
                    final List<Member> list0 =
                        listCalc0.evaluateList(evaluator);
                    final List<Member> list1 =
                        listCalc1.evaluateList(evaluator);
                    return toggleDrillStateMembers(evaluator, list0, list1);
                }
            };
        } else {
            return new AbstractListCalc(call, new Calc[] {listCalc0, listCalc1})
            {
                public List evaluateList(Evaluator evaluator) {
                    final List<Member[]> list0 =
                        listCalc0.evaluateList(evaluator);
                    final List<Member> list1 =
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

    }

    public Calc compileCall(final ResolvedFunCall call, ExpCompiler compiler) {
        final ListCalc listCalc1 = compiler.compileList(call.getArg(0));
        final ListCalc listCalc2 = compiler.compileList(call.getArg(1));
        return new AbstractListCalc(
            call, new Calc[] {listCalc1, listCalc2}, false)
        {
            public List evaluateList(Evaluator evaluator) {
                SchemaReader schemaReader = evaluator.getSchemaReader();
                // evaluate the arguments in non empty mode
View Full Code Here

Examples of mondrian.calc.impl.AbstractListCalc

        final ListCalc listCalc1 = compiler.compileList(call.getArg(0));
        final ListCalc listCalc2 = compiler.compileList(call.getArg(1));
        final String literalArg = getLiteralArg(call, 2, "", reservedWords);
        final boolean recursive = literalArg.equals("RECURSIVE");

        return new AbstractListCalc(call, new Calc[] {listCalc1, listCalc2}) {
            public List evaluateList(Evaluator evaluator) {
                final List<?> list1 = listCalc1.evaluateList(evaluator);
                final List<Member> list2 = listCalc2.evaluateList(evaluator);
                return drilldownMember(list1, list2, evaluator);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.