mondrian.olap.fun
Class ResultStyleCompiler.MultiCalc

java.lang.Object
  extended by mondrian.olap.fun.ResultStyleCompiler.MultiCalc
All Implemented Interfaces:
Calc
Enclosing class:
ResultStyleCompiler

static class ResultStyleCompiler.MultiCalc
extends 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
(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
           
 
Constructor Summary
ResultStyleCompiler.MultiCalc(Calc calcIter, Calc calcList, Calc calcMList, boolean onlyMutableList)
           
 
Method Summary
 void accept(CalcWriter calcWriter)
          Prints this expression, by accepting a visiting CalcWriter.
protected  boolean compare(Object v1, Object v2)
           
 boolean dependsOn(Hierarchy hierarchy)
          Returns whether this expression depends upon a given hierarchy.
 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(Class<?> iface)
           
protected  void print(Member[] ma)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counter

static int counter

calcIter

final Calc calcIter

calcList

final Calc calcList

calcMList

final Calc calcMList

onlyMutableList

final boolean onlyMutableList

lineNumber

int lineNumber

cnt

int cnt
Constructor Detail

ResultStyleCompiler.MultiCalc

ResultStyleCompiler.MultiCalc(Calc calcIter,
                              Calc calcList,
                              Calc calcMList,
                              boolean onlyMutableList)
Method Detail

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
Specified by:
isWrapperFor in interface Calc

unwrap

public <T> T unwrap(Class<T> iface)
Specified by:
unwrap in interface Calc

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 Object evaluate(Evaluator evaluator)
Description copied from interface: Calc
Evaluates this expression.

Specified by:
evaluate in interface Calc
Parameters:
evaluator - Provides dimensional context in which to evaluate this expression
Returns:
Result of expression evaluation

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:

Specified by:
dependsOn in interface Calc
Parameters:
hierarchy - Hierarchy
Returns:
Whether this expression's result depends upon the current member of the hierarchy

getType

public Type getType()
Description copied from interface: Calc
Returns the type of this expression.

Specified by:
getType in interface Calc

accept

public void accept(CalcWriter calcWriter)
Description copied from interface: Calc
Prints this expression, by accepting a visiting CalcWriter.

Specified by:
accept in interface Calc
Parameters:
calcWriter - Writer

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 interface Calc
See Also:
ExpCompiler.compileList(mondrian.olap.Exp, boolean)

compare

protected boolean compare(Object v1,
                          Object v2)

print

protected void print(Member[] ma)

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads