Package mondrian.calc.impl
Class AbstractListCalc
- java.lang.Object
-
- mondrian.calc.impl.AbstractCalc
-
- mondrian.calc.impl.AbstractListCalc
-
- Direct Known Subclasses:
IterableListCalc
,NativizeSetFunDef.NativeListCalc
,SetFunDef.SetListCalc
public abstract class AbstractListCalc extends AbstractCalc implements ListCalc
Abstract implementation of theListCalc
interface.The derived class must implement the
ListCalc.evaluateList(mondrian.olap.Evaluator)
method, and theevaluate(mondrian.olap.Evaluator)
method will call it.- Since:
- Sep 27, 2005
- Author:
- jhyde
-
-
Field Summary
-
Fields inherited from class mondrian.calc.impl.AbstractCalc
exp, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractListCalc(Exp exp, Calc[] calcs)
Creates an abstract implementation of a compiled expression which returns a mutable list of tuples.protected
AbstractListCalc(Exp exp, Calc[] calcs, boolean mutable)
Creates an abstract implementation of a compiled expression which returns a list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
evaluate(Evaluator evaluator)
Evaluates this expression.TupleIterable
evaluateIterable(Evaluator evaluator)
Evaluates an expression to yield an Iterable of members or tuples.ResultStyle
getResultStyle()
Returns style in which the result of evaluating this expression is returned.SetType
getType()
Returns the type of this expression.String
toString()
-
Methods inherited from class mondrian.calc.impl.AbstractCalc
accept, anyDepends, anyDependsButFirst, butDepends, collectArguments, dependsOn, getArguments, getCalcs, getName, isWrapperFor, simplifyEvaluator, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface mondrian.calc.Calc
accept, dependsOn, isWrapperFor, unwrap
-
Methods inherited from interface mondrian.calc.ListCalc
evaluateList
-
-
-
-
Constructor Detail
-
AbstractListCalc
protected AbstractListCalc(Exp exp, Calc[] calcs)
Creates an abstract implementation of a compiled expression which returns a mutable list of tuples.- Parameters:
exp
- Expression which was compiledcalcs
- List of child compiled expressions (for dependency analysis)
-
AbstractListCalc
protected AbstractListCalc(Exp exp, Calc[] calcs, boolean mutable)
Creates an abstract implementation of a compiled expression which returns a list.- Parameters:
exp
- Expression which was compiledcalcs
- List of child compiled expressions (for dependency analysis)mutable
- Whether the list is mutable
-
-
Method Detail
-
getType
public SetType getType()
Description copied from interface:Calc
Returns the type of this expression.- Specified by:
getType
in interfaceCalc
- Overrides:
getType
in classAbstractCalc
-
evaluate
public final Object evaluate(Evaluator evaluator)
Description copied from interface:Calc
Evaluates this expression.
-
evaluateIterable
public TupleIterable evaluateIterable(Evaluator evaluator)
Description copied from interface:IterCalc
Evaluates an expression to yield an Iterable of members or tuples.The Iterable is immutable.
- Specified by:
evaluateIterable
in interfaceIterCalc
- Parameters:
evaluator
- Evaluation context- Returns:
- An Iterable of members or tuples, never null.
-
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
- Overrides:
getResultStyle
in classAbstractCalc
- See Also:
ExpCompiler.compileList(mondrian.olap.Exp, boolean)
-
-