Package mondrian.mdx

Examples of mondrian.mdx.ResolvedFunCall


                    (RolapStoredMeasure) member, baseCubes, baseCubeList);
            } else if (member instanceof RolapCalculatedMember) {
                findMeasures(member.getExpression(), baseCubes, baseCubeList);
            }
        } else if (exp instanceof ResolvedFunCall) {
            ResolvedFunCall funCall = (ResolvedFunCall) exp;
            Exp [] args = funCall.getArgs();
            for (Exp arg : args) {
                findMeasures(arg, baseCubes, baseCubeList);
            }
        }
    }
View Full Code Here


    // SqlMemberSource.RolapParentChildMemberNoClosure
    public Exp getExpression() {
        Exp exp = member.getExpression();
        if (exp instanceof ResolvedFunCall) {
            // convert any args to RolapCubeHierarchies
            ResolvedFunCall fcall = (ResolvedFunCall)exp;
            for (int i = 0; i < fcall.getArgCount(); i++) {
                if (fcall.getArg(i) instanceof HierarchyExpr) {
                    HierarchyExpr expr = (HierarchyExpr)fcall.getArg(i);
                    if (expr.getHierarchy().equals(
                        member.getHierarchy()))
                    {
                        fcall.getArgs()[i] =
                            new HierarchyExpr(this.getHierarchy());
                    }
                }
            }
        }
View Full Code Here

                    ResultStyle.ITERABLE_LIST_MUTABLELIST,
                    calc.getResultStyle());
            }
        } else if (TypeUtil.couldBeMember(type)) {
            final MemberCalc memberCalc = compiler.compileMember(arg);
            final ResolvedFunCall call = wrapAsSet(arg);
            return new AbstractMemberIterCalc(call, new Calc[] {memberCalc}) {
                public Iterable<Member> evaluateMemberIterable(
                    Evaluator evaluator)
                {
                    final Member member =
                        memberCalc.evaluateMember(evaluator);
                    return new Iterable<Member>() {
                        public Iterator<Member> iterator() {
                            return new Iterator<Member>() {
                                private Member m = member;
                                public boolean hasNext() {
                                    return (m != null);
                                }
                                public Member next() {
                                    try {
                                        return m;
                                    } finally {
                                        m = null;
                                    }
                                }
                                public void remove() {
                                    throw new UnsupportedOperationException(
                                        "remove");
                                }
                            };
                        }
                    };
                }
                protected String getName() {
                    return "Sublist";
                }
            };
        } else {
            final TupleCalc tupleCalc = compiler.compileTuple(arg);
            final ResolvedFunCall call = wrapAsSet(arg);
            return new AbstractTupleIterCalc(call, new Calc[] {tupleCalc}) {
                public Iterable<Member[]> evaluateTupleIterable(
                    Evaluator evaluator)
                {
                    final Member[] members = tupleCalc.evaluateTuple(evaluator);
View Full Code Here

                type = ((SetType) argType).getElementType();
            } else {
                type = argType;
            }
        }
        return new ResolvedFunCall(
            new SetFunDef(Resolver, categories),
            args,
            new SetType(type));
    }
View Full Code Here

     * call, if any, then prints the last part of the class name.
     */
    protected String getName() {
        String name;
        if (exp instanceof ResolvedFunCall) {
            ResolvedFunCall funCall = (ResolvedFunCall) exp;
            name = funCall.getFunDef().getName();
        } else {
            name = getClass().getName();
            int dot = name.lastIndexOf('.');
            int dollar = name.lastIndexOf('$');
            int dotDollar = Math.max(dot, dollar);
View Full Code Here

     * @param member Wrapper member
     * @return Wrapped scenario
     */
    static Scenario forMember(final RolapMember member) {
        final Formula formula = ((RolapCalculatedMember) member).getFormula();
        final ResolvedFunCall resolvedFunCall =
            (ResolvedFunCall) formula.getExpression();
        final Calc calc = resolvedFunCall.getFunDef().compileCall(null, null);
        return ((ScenarioCalc) calc).getScenario();
    }
View Full Code Here

     * @param exp Expression
     * @return Whether expression contains a call to an aggregate function.
     */
    private static boolean foundAggregateFunction(Exp exp) {
        if (exp instanceof ResolvedFunCall) {
            ResolvedFunCall resolvedFunCall = (ResolvedFunCall) exp;
            if (resolvedFunCall.getFunDef() instanceof AggregateFunDef) {
                return true;
            } else {
                for (Exp argExp : resolvedFunCall.getArgs()) {
                    if (foundAggregateFunction(argExp)) {
                        return true;
                    }
                }
            }
View Full Code Here

            exp = namedSet.getExp();
        }
        if (!(exp instanceof ResolvedFunCall)) {
            return null;
        }
        final ResolvedFunCall funCall = (ResolvedFunCall) exp;
        FunDef fun = funCall.getFunDef();
        Exp[] args = funCall.getArgs();

        final Role role = evaluator.getSchemaReader().getRole();
        CrossJoinArg[] cjArgs;

        cjArgs = checkMemberChildren(role, fun, args);
View Full Code Here

    private boolean isConstrainedMeasure(Exp arg) {
        if (!(arg instanceof MemberExpr
            && ((MemberExpr) arg).getMember().isMeasure()))
        {
            if (arg instanceof ResolvedFunCall) {
                ResolvedFunCall call = (ResolvedFunCall) arg;
                if (call.getFunDef() instanceof SetFunDef
                    || call.getFunDef() instanceof ParenthesesFunDef)
                {
                    return allArgsConstrainedMeasure(call.getArgs());
                }
            }
            return false;
        }
        Member member = ((MemberExpr) arg).getMember();
View Full Code Here

    private void addConstrainingMembersToMap(
        Exp arg, Map<Dimension, List<RolapMember>> memberLists)
    {
        if (arg instanceof ResolvedFunCall) {
            ResolvedFunCall call = (ResolvedFunCall) arg;
            for (Exp callArg : call.getArgs()) {
                addConstrainingMembersToMap(callArg, memberLists);
            }
        }
        Exp[] tupleArgs = getCalculatedTupleArgs(arg);
        for (Exp tupleArg : tupleArgs) {
View Full Code Here

TOP

Related Classes of mondrian.mdx.ResolvedFunCall

Copyright © 2018 www.massapicom. 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.