Skip to content

Commit

Permalink
MONDRIAN: Oops! And one missed file.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 12733]
  • Loading branch information
julianhyde committed May 16, 2009
1 parent af76b90 commit f31ed41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/main/mondrian/olap/fun/JavaFunDef.java
Expand Up @@ -338,6 +338,7 @@ public JavaMethodCalc(
}

public Object evaluate(Evaluator evaluator) {
final Calc[] calcs = getCalcs();
for (int i = 0; i < args.length; i++) {
args[i] = calcs[i].evaluate(evaluator);
if (args[i] == null) {
Expand Down
20 changes: 7 additions & 13 deletions src/main/mondrian/olap/fun/SumFunDef.java
Expand Up @@ -16,7 +16,6 @@
import mondrian.mdx.ResolvedFunCall;

import java.util.List;
import java.util.Collections;

/**
* Definition of the <code>Sum</code> MDX function.
Expand Down Expand Up @@ -92,8 +91,10 @@ protected Calc compileCall(
return genIterCalc(call, ncalc, calc);
}
}
protected Calc genIterCalc(final ResolvedFunCall call,
final Calc ncalc, final Calc calc) {

protected Calc genIterCalc(
final ResolvedFunCall call, final Calc ncalc, final Calc calc)
{
return new AbstractDoubleCalc(call, new Calc[] {ncalc, calc}) {
public double evaluateDouble(Evaluator evaluator) {
IterCalc iterCalc = (IterCalc) ncalc;
Expand All @@ -102,29 +103,22 @@ public double evaluateDouble(Evaluator evaluator) {
return sumDouble(evaluator.push(), iterable, calc);
}

public Calc[] getCalcs() {
return new Calc[] {ncalc, calc};
}

public boolean dependsOn(Dimension dimension) {
return anyDependsButFirst(getCalcs(), dimension);
}
};
}

protected Calc genListCalc(final ResolvedFunCall call,
final Calc ncalc, final Calc calc) {
protected Calc genListCalc(
final ResolvedFunCall call, final Calc ncalc, final Calc calc)
{
return new AbstractDoubleCalc(call, new Calc[] {ncalc, calc}) {
public double evaluateDouble(Evaluator evaluator) {
ListCalc listCalc = (ListCalc) ncalc;
List memberList = evaluateCurrentList(listCalc, evaluator);
return sumDouble(evaluator.push(false), memberList, calc);
}

public Calc[] getCalcs() {
return new Calc[] {ncalc, calc};
}

public boolean dependsOn(Dimension dimension) {
return anyDependsButFirst(getCalcs(), dimension);
}
Expand Down

0 comments on commit f31ed41

Please sign in to comment.