Class NativizeSetFunDef.NonNativeCalc

    • Field Detail

      • parent

        final Calc parent
      • nativeEnabled

        final boolean nativeEnabled
    • Constructor Detail

      • NonNativeCalc

        protected NonNativeCalc​(Calc parent,
                                boolean nativeEnabled)
    • 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
      • dependsOn

        public boolean dependsOn​(Hierarchy hierarchy)
        Description copied from interface: Calc
        Returns whether this expression depends upon a given 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:

        • The expression
          [Measures].[Unit Sales]
          depends on all dimensions except [Measures].
        • The boolean expression
          ([Measures].[Unit Sales], [Time].[1997]) > 1000
          depends on all hierarchies except [Measures] and [Time].
        • The list expression
          Filter([Store].[USA].Children, [Measures].[Unit Sales] < 50)
          depends upon all hierarchies except [Store] and [Measures]. How so? Normally the scalar expression would depend upon all hierarchies except [Measures], but the Filter function sets the [Store] context before evaluating the scalar expression, so it is not inherited from the surrounding context.

        Specified by:
        dependsOn in interface Calc
        Parameters:
        hierarchy - Hierarchy
        Returns:
        Whether this expression's result depends upon the current member of the hierarchy
      • getType

        public Type getType()
        Description copied from interface: Calc
        Returns the type of this expression.
        Specified by:
        getType in interface Calc
      • accept

        public void accept​(CalcWriter calcWriter)
        Description copied from interface: Calc
        Prints this expression, by accepting a visiting CalcWriter.
        Specified by:
        accept in interface Calc
        Parameters:
        calcWriter - Writer
      • 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
        See Also:
        ExpCompiler.compileList(mondrian.olap.Exp, boolean)
      • isWrapperFor

        public boolean isWrapperFor​(Class<?> iface)
        Default implementation just does 'instanceof TargetClass'. Subtypes that are wrappers should override.
        Specified by:
        isWrapperFor in interface Calc
      • unwrap

        public <T> T unwrap​(Class<T> iface)
        Default implementation just casts to TargetClass. Subtypes that are wrappers should override.
        Specified by:
        unwrap in interface Calc