|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.calc.impl.DelegatingExpCompiler
public class DelegatingExpCompiler
Abstract implementation of ExpCompiler
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface mondrian.calc.ExpCompiler |
---|
ExpCompiler.Factory |
Constructor Summary | |
---|---|
protected |
DelegatingExpCompiler(ExpCompiler parent)
|
Method Summary | |
---|---|
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 List
result. |
ListCalc |
compileList(Exp exp,
boolean mutable)
Compiles an expression which yields List 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 ResultStyle s
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DelegatingExpCompiler(ExpCompiler parent)
Method Detail |
---|
protected Calc afterCompile(Exp exp, Calc calc, boolean mutable)
exp
- Expression to compilecalc
- Calculator created by compilermutable
- Whether the result is mutuable
public Evaluator getEvaluator()
ExpCompiler
getEvaluator
in interface ExpCompiler
public Validator getValidator()
ExpCompiler
getValidator
in interface ExpCompiler
public Calc compile(Exp exp)
ExpCompiler
compile
in interface ExpCompiler
exp
- Expression
public Calc compileAs(Exp exp, Type resultType, List<ResultStyle> preferredResultTypes)
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
exp
- 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)
ExpCompiler
Member
result.
compileMember
in interface ExpCompiler
public LevelCalc compileLevel(Exp exp)
ExpCompiler
Level
result.
compileLevel
in interface ExpCompiler
public DimensionCalc compileDimension(Exp exp)
ExpCompiler
Dimension
result.
compileDimension
in interface ExpCompiler
public HierarchyCalc compileHierarchy(Exp exp)
ExpCompiler
Hierarchy
result.
compileHierarchy
in interface ExpCompiler
public IntegerCalc compileInteger(Exp exp)
ExpCompiler
int
result.
The expression is implicitly converted into a scalar.
compileInteger
in interface ExpCompiler
public StringCalc compileString(Exp exp)
ExpCompiler
String
result.
The expression is implicitly converted into a scalar.
compileString
in interface ExpCompiler
public DateTimeCalc compileDateTime(Exp exp)
ExpCompiler
Date
result.
The expression is implicitly converted into a scalar.
compileDateTime
in interface ExpCompiler
public ListCalc compileList(Exp exp)
ExpCompiler
List
result.
Always equivalent to
.
ExpCompiler.compileList(mondrian.olap.Exp)
(exp, false)
compileList
in interface ExpCompiler
public ListCalc compileList(Exp exp, boolean mutable)
ExpCompiler
List
result.
Such an expression is generally a list of Member
objects or a
list of tuples (each represented by a Member
array).
See ExpCompiler.compileList(mondrian.olap.Exp)
.
compileList
in interface ExpCompiler
exp
- Expressionmutable
- Whether resulting list is mutablepublic IterCalc compileIter(Exp exp)
ExpCompiler
Iterable
result.
compileIter
in interface ExpCompiler
exp
- Expression
public BooleanCalc compileBoolean(Exp exp)
ExpCompiler
boolean
result.
compileBoolean
in interface ExpCompiler
exp
- Expression
public DoubleCalc compileDouble(Exp exp)
ExpCompiler
double
result.
compileDouble
in interface ExpCompiler
exp
- Expression
public TupleCalc compileTuple(Exp exp)
ExpCompiler
compileTuple
in interface ExpCompiler
exp
- Expression
public Calc compileScalar(Exp exp, boolean scalar)
ExpCompiler
If 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 ExpCompiler
exp
- 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)
ExpCompiler
registerParameter
in interface ExpCompiler
parameter
- Parameter
public List<ResultStyle> getAcceptableResultStyles()
ExpCompiler
ResultStyle
s
acceptable to the caller.
getAcceptableResultStyles
in interface ExpCompiler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |