mondrian.calc.impl
Class AbstractIterCalc

java.lang.Object
  extended by mondrian.calc.impl.AbstractCalc
      extended by mondrian.calc.impl.AbstractIterCalc
All Implemented Interfaces:
Calc, IterCalc

public abstract class AbstractIterCalc
extends AbstractCalc
implements IterCalc

Abstract implementation of the IterCalc interface.

The derived class must implement the IterCalc.evaluateIterable(mondrian.olap.Evaluator) method, and the evaluate(mondrian.olap.Evaluator) method will call it.

Since:
Jan 14, 2007
Version:
$Id: //open/mondrian/src/main/mondrian/calc/impl/AbstractIterCalc.java#8 $
Author:
Richard M. Emberson

Field Summary
protected  boolean tuple
           
 
Fields inherited from class mondrian.calc.impl.AbstractCalc
exp, type
 
Constructor Summary
protected AbstractIterCalc(Exp exp, Calc[] calcs)
          Creates an abstract implementation of a compiled expression which returns an Iterable.
 
Method Summary
 Object evaluate(Evaluator evaluator)
          Evaluates this expression.
protected  Iterable evaluateEitherIterable(Evaluator evaluator)
          Helper method with which to implement IterCalc.evaluateIterable(mondrian.olap.Evaluator) if you have implemented evaluateMemberIterable(mondrian.olap.Evaluator) and evaluateTupleIterable(mondrian.olap.Evaluator).
 Iterable<Member> evaluateMemberIterable(Evaluator evaluator)
          Available implementation of MemberIterCalc.evaluateMemberIterable(mondrian.olap.Evaluator) if the subclass chooses to implement MemberIterCalc.
 Iterable<Member[]> evaluateTupleIterable(Evaluator evaluator)
          Available implementation of TupleIterCalc.evaluateTupleIterable(mondrian.olap.Evaluator) if the subclass chooses to implement TupleIterCalc.
 ResultStyle getResultStyle()
          Returns style in which the result of evaluating this expression is returned.
 
Methods inherited from class mondrian.calc.impl.AbstractCalc
accept, anyDepends, anyDependsButFirst, butDepends, dependsOn, getArguments, getCalcs, getName, getType, simplifyEvaluator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mondrian.calc.IterCalc
evaluateIterable
 
Methods inherited from interface mondrian.calc.Calc
accept, dependsOn, getType
 

Field Detail

tuple

protected final boolean tuple
Constructor Detail

AbstractIterCalc

protected AbstractIterCalc(Exp exp,
                           Calc[] calcs)
Creates an abstract implementation of a compiled expression which returns an Iterable.

Parameters:
exp - Expression which was compiled
calcs - List of child compiled expressions (for dependency analysis)
Method Detail

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

evaluateEitherIterable

protected Iterable evaluateEitherIterable(Evaluator evaluator)
Helper method with which to implement IterCalc.evaluateIterable(mondrian.olap.Evaluator) if you have implemented evaluateMemberIterable(mondrian.olap.Evaluator) and evaluateTupleIterable(mondrian.olap.Evaluator).

Parameters:
evaluator - Evaluator
Returns:
List

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
Overrides:
getResultStyle in class AbstractCalc
See Also:
ExpCompiler.compileList(mondrian.olap.Exp, boolean)

evaluateMemberIterable

public Iterable<Member> evaluateMemberIterable(Evaluator evaluator)
Available implementation of MemberIterCalc.evaluateMemberIterable(mondrian.olap.Evaluator) if the subclass chooses to implement MemberIterCalc.

Parameters:
evaluator - Evaluation context
Returns:
A member iterator, never null

evaluateTupleIterable

public Iterable<Member[]> evaluateTupleIterable(Evaluator evaluator)
Available implementation of TupleIterCalc.evaluateTupleIterable(mondrian.olap.Evaluator) if the subclass chooses to implement TupleIterCalc.

Parameters:
evaluator - Evaluation context
Returns:
A tuple iterator, never null

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