public interface Calc
Calcis the base class for all calculable expressions.
<Member>.CurrentMemberfunction) are made explicit in the physical language.
ExpCompiler). There are often more than one evaluation strategy for a given expression, and compilation process gives us an opportunity to choose the optimal one.
Calcinterface has sub-interfaces for various types:
StringCalcare scalar expressions;
DimensionCalcyield elements of the OLAP model. Each of these sub-interfaces has an abstract implementation:
GenericCalcis an adapter which implements all of these interfaces and will try to convert any given result to the correct type. Use it sparingly: if you know the expected result type, it is better to write a class which implements a specific
|Modifier and Type||Method and Description|
Prints this expression, by accepting a visiting
Returns whether this expression depends upon a given hierarchy.
Evaluates this expression.
Returns style in which the result of evaluating this expression is returned.
Returns the type of this expression.
evaluator- Provides dimensional context in which to evaluate this expression
boolean dependsOn(Hierarchy 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:
depends on all dimensions except
depends on all hierarchies except [Measures] and [Time].
([Measures].[Unit Sales], [Time].) > 1000
depends upon all hierarchies except [Store] and [Measures]. How so? Normally the scalar expression would depend upon all hierarchies except [Measures], but the
Filter([Store].[USA].Children, [Measures].[Unit Sales] < 50)
Filterfunction sets the [Store] context before evaluating the scalar expression, so it is not inherited from the surrounding context.
void accept(CalcWriter calcWriter)
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.
boolean isWrapperFor(Class<?> iface)
<T> T unwrap(Class<T> iface)
Copyright © 2019 Hitachi Vantara. All rights reserved.