public class DelegatingExpCompiler extends Object implements ExpCompiler
ExpCompilerExpCompiler.Factory| Modifier | Constructor and Description |
|---|---|
protected |
DelegatingExpCompiler(ExpCompiler parent) |
| Modifier and Type | Method and Description |
|---|---|
protected Calc |
afterCompile(Exp exp,
Calc calc,
boolean mutable)
Hook for post-processing.
|
Calc |
compile(Exp exp)
Compiles an expression.
|
Calc |
compileAs(Exp exp,
Type resultType,
List<ResultStyle> preferredResultTypes)
Compiles an expression to a given result type.
|
BooleanCalc |
compileBoolean(Exp exp)
Compiles an expression which yields a
boolean result. |
DateTimeCalc |
compileDateTime(Exp exp)
Compiles an expression which yields a
Date result. |
DimensionCalc |
compileDimension(Exp exp)
Compiles an expression which yields a
Dimension result. |
DoubleCalc |
compileDouble(Exp exp)
Compiles an expression which yields a
double result. |
HierarchyCalc |
compileHierarchy(Exp exp)
Compiles an expression which yields a
Hierarchy result. |
IntegerCalc |
compileInteger(Exp exp)
Compiles an expression which yields an
int result. |
IterCalc |
compileIter(Exp exp)
Compiles an expression which yields an immutable
Iterable result. |
LevelCalc |
compileLevel(Exp exp)
Compiles an expression which yields a
Level result. |
ListCalc |
compileList(Exp exp)
Compiles an expression which yields an immutable
TupleList
result. |
ListCalc |
compileList(Exp exp,
boolean mutable)
Compiles an expression which yields
TupleList result. |
MemberCalc |
compileMember(Exp exp)
Compiles an expression which yields a
Member result. |
Calc |
compileScalar(Exp exp,
boolean scalar)
Compiles an expression to yield a scalar result.
|
StringCalc |
compileString(Exp exp)
Compiles an expression which yields a
String result. |
TupleCalc |
compileTuple(Exp exp)
Compiles an expression which yields a tuple result.
|
List<ResultStyle> |
getAcceptableResultStyles()
Returns a list of the
ResultStyles
acceptable to the caller. |
Evaluator |
getEvaluator()
Returns the evaluator to be used for evaluating expressions during the
compilation process.
|
Validator |
getValidator()
Returns the validator which was used to validate this expression.
|
ParameterSlot |
registerParameter(Parameter parameter)
Implements a parameter, returning a unique slot which will hold the
parameter's value.
|
protected DelegatingExpCompiler(ExpCompiler parent)
protected Calc afterCompile(Exp exp, Calc calc, boolean mutable)
exp - Expression to compilecalc - Calculator created by compilermutable - Whether the result is mutuablepublic Evaluator getEvaluator()
ExpCompilergetEvaluator in interface ExpCompilerpublic Validator getValidator()
ExpCompilergetValidator in interface ExpCompilerpublic Calc compile(Exp exp)
ExpCompilercompile in interface ExpCompilerexp - Expressionpublic Calc compileAs(Exp exp, Type resultType, List<ResultStyle> preferredResultTypes)
ExpCompilerIf 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 ExpCompilerexp - ExpressionresultType - Desired result type, or null to use expression's
current typepreferredResultTypes - List of result types, in descending order
of preference. Never null.public MemberCalc compileMember(Exp exp)
ExpCompilerMember result.compileMember in interface ExpCompilerpublic LevelCalc compileLevel(Exp exp)
ExpCompilerLevel result.compileLevel in interface ExpCompilerpublic DimensionCalc compileDimension(Exp exp)
ExpCompilerDimension result.compileDimension in interface ExpCompilerpublic HierarchyCalc compileHierarchy(Exp exp)
ExpCompilerHierarchy result.compileHierarchy in interface ExpCompilerpublic IntegerCalc compileInteger(Exp exp)
ExpCompilerint result.
The expression is implicitly converted into a scalar.compileInteger in interface ExpCompilerpublic StringCalc compileString(Exp exp)
ExpCompilerString result.
The expression is implicitly converted into a scalar.compileString in interface ExpCompilerpublic DateTimeCalc compileDateTime(Exp exp)
ExpCompilerDate result.
The expression is implicitly converted into a scalar.compileDateTime in interface ExpCompilerpublic final ListCalc compileList(Exp exp)
ExpCompilerTupleList
result.
Always equivalent to .ExpCompiler.compileList(mondrian.olap.Exp)(exp, false)
compileList in interface ExpCompilerpublic ListCalc compileList(Exp exp, boolean mutable)
ExpCompilerTupleList result.
Such an expression is generally a list of Member objects or a
list of tuples (each represented by a Member array).
compileList in interface ExpCompilerexp - Expressionmutable - Whether resulting list is mutablepublic IterCalc compileIter(Exp exp)
ExpCompilerIterable result.compileIter in interface ExpCompilerexp - Expressionpublic BooleanCalc compileBoolean(Exp exp)
ExpCompilerboolean result.compileBoolean in interface ExpCompilerexp - Expressionpublic DoubleCalc compileDouble(Exp exp)
ExpCompilerdouble result.compileDouble in interface ExpCompilerexp - Expressionpublic TupleCalc compileTuple(Exp exp)
ExpCompilercompileTuple in interface ExpCompilerexp - Expressionpublic Calc compileScalar(Exp exp, boolean scalar)
ExpCompilerIf the expression yields a member or tuple, the calculator will automatically apply that member or tuple to the current dimensional context and return the value of the current measure.
compileScalar in interface ExpCompilerexp - Expressionscalar - Whether to try to use the specific compile method for
scalar types. For example, if specific is true and
exp is a string expression, calls
ExpCompiler.compileString(mondrian.olap.Exp)public ParameterSlot registerParameter(Parameter parameter)
ExpCompilerregisterParameter in interface ExpCompilerparameter - Parameterpublic List<ResultStyle> getAcceptableResultStyles()
ExpCompilerResultStyles
acceptable to the caller.getAcceptableResultStyles in interface ExpCompilerCopyright © 2018 Hitachi Vantara. All rights reserved.