Package mondrian.olap.fun
Class ResultStyleCompiler.MultiCalc
- java.lang.Object
-
- mondrian.olap.fun.ResultStyleCompiler.MultiCalc
-
- All Implemented Interfaces:
Calc
- Enclosing class:
- ResultStyleCompiler
static class ResultStyleCompiler.MultiCalc extends java.lang.Object implements Calc
Calc with three child Calcs, one for ITERABLE, LIST and MUTABLE_LIST, which are evaluated during the normal evaluation process.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Calc
calcIter
(package private) Calc
calcList
(package private) Calc
calcMList
(package private) int
cnt
(package private) static int
counter
(package private) int
lineNumber
(package private) boolean
onlyMutableList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(CalcWriter calcWriter)
Prints this expression, by accepting a visitingCalcWriter
.protected boolean
compare(java.lang.Object v1, java.lang.Object v2)
boolean
dependsOn(Hierarchy hierarchy)
Returns whether this expression depends upon a given hierarchy.java.lang.Object
evaluate(Evaluator evaluator)
Evaluates this expression.protected boolean
finalEval()
Returns whether this is a final evaluation; the one that takes place after the while-loop in the RolapResult constructor.ResultStyle
getResultStyle()
Returns style in which the result of evaluating this expression is returned.Type
getType()
Returns the type of this expression.boolean
isWrapperFor(java.lang.Class<?> iface)
protected void
print(Member[] ma)
<T> T
unwrap(java.lang.Class<T> iface)
-
-
-
Method Detail
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface)
- Specified by:
isWrapperFor
in interfaceCalc
-
finalEval
protected boolean finalEval()
Returns whether this is a final evaluation; the one that takes place after the while-loop in the RolapResult constructor.- Returns:
- true if this is a final evaluation
-
evaluate
public java.lang.Object evaluate(Evaluator evaluator)
Description copied from interface:Calc
Evaluates this expression.
-
dependsOn
public boolean dependsOn(Hierarchy hierarchy)
Description copied from interface:Calc
Returns whether this expression depends upon a given hierarchy.If it does not depend on the hierarchy, then re-evaluating the expression with a different member of this context must produce the same answer.
Some examples:- The expression
depends on all dimensions except[Measures].[Unit Sales]
[Measures]
. - The boolean expression
depends on all hierarchies except [Measures] and [Time].([Measures].[Unit Sales], [Time].[1997]) > 1000
- The list expression
depends upon all hierarchies except [Store] and [Measures]. How so? Normally the scalar expression would depend upon all hierarchies except [Measures], but theFilter([Store].[USA].Children, [Measures].[Unit Sales] < 50)
Filter
function sets the [Store] context before evaluating the scalar expression, so it is not inherited from the surrounding context.
- The expression
-
getType
public Type getType()
Description copied from interface:Calc
Returns the type of this expression.
-
accept
public void accept(CalcWriter calcWriter)
Description copied from interface:Calc
Prints this expression, by accepting a visitingCalcWriter
.
-
getResultStyle
public ResultStyle getResultStyle()
Description copied from interface:Calc
Returns style in which the result of evaluating this expression is returned.One application of this method is for the compiler to figure out whether the compiled expression is returning a mutable list. If a mutable list is required, the compiler can create a mutable copy.
- Specified by:
getResultStyle
in interfaceCalc
- See Also:
ExpCompiler.compileList(mondrian.olap.Exp, boolean)
-
compare
protected boolean compare(java.lang.Object v1, java.lang.Object v2)
-
print
protected void print(Member[] ma)
-
-