|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.calc.impl.DelegatingExpCompiler mondrian.olap.fun.ResultStyleCompiler
public class ResultStyleCompiler
The ResultStyleCompiler
can be used to assure that
the use of the container ResultStyle: ITERABLE, LIST and MUTABLE_LIST;
can be requested by any Calc. This ExpCompiler injects into the
Exp hierarchy a special Calc, the MultiCalc, that evaluates
its three child Calc's (one for ITERABLE, LIST and MUTABLE_LIST)
and compares the lists returned to make sure that they are the
same. This comparison can only be done when the Member evaluation
stage of query evaluation is begin done the last time.
[Think about it - how can you tell when the evaluation is happening
for the last time.] Evaluation is called from the RolapResult's
constructor calling the method executeAxis. This happens one or
more times in the while-loop. These evaluations may not be complete;
you can not necessarily compare results. Then, evaluation occurs
just below the while-loop, again calling executeAxis. In this
case the evaluation is complete. The trick is to llok a the
stack and when one changes the line number from which one is
being called, then one knows one is being called by the second
executeAxis call in the RolapResult constructor.
Nested Class Summary | |
---|---|
(package private) static class |
ResultStyleCompiler.MultiCalc
Calc with three child Calcs, one for ITERABLE, LIST and MUTABLE_LIST, which are evaluated during the normal evaluation process. |
Nested classes/interfaces inherited from interface mondrian.calc.ExpCompiler |
---|
ExpCompiler.Factory |
Constructor Summary | |
---|---|
ResultStyleCompiler(Evaluator evaluator,
Validator validator,
List<ResultStyle> resultStyles)
Constructor which uses the ExpCompiler.Factory to get the default ExpCompiler as an instance variable - ResultStyleCompiler is a wrapper. |
Method Summary | |
---|---|
Calc |
compile(Exp exp)
Compiles an expression. |
Calc |
compileAs(Exp exp,
Type resultType,
List<ResultStyle> resultStyles)
Compiles an expression to a given result type. |
Methods inherited from class mondrian.calc.impl.DelegatingExpCompiler |
---|
afterCompile, compileBoolean, compileDateTime, compileDimension, compileDouble, compileHierarchy, compileInteger, compileIter, compileLevel, compileList, compileList, compileMember, compileScalar, compileString, compileTuple, getAcceptableResultStyles, getEvaluator, getValidator, registerParameter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResultStyleCompiler(Evaluator evaluator, Validator validator, List<ResultStyle> resultStyles)
Method Detail |
---|
public Calc compile(Exp exp)
ExpCompiler
compile
in interface ExpCompiler
compile
in class DelegatingExpCompiler
exp
- Expression
public Calc compileAs(Exp exp, Type resultType, List<ResultStyle> resultStyles)
ExpCompiler
If resultType
is not null, casts the expression to that
type. Throws an exception if that conversion is not allowed by the
type system.
The preferredResultStyles
parameter specifies a list
of desired result styles. It must not be null, but may be empty.
compileAs
in interface ExpCompiler
compileAs
in class DelegatingExpCompiler
exp
- ExpressionresultType
- Desired result type, or null to use expression's
current typeresultStyles
- List of result types, in descending order
of preference. Never null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |