Class GenericCalc

    • Constructor Detail

      • GenericCalc

        protected GenericCalc​(Exp exp)
        Creates a GenericCalc without specifying child calculated expressions.

        Subclass should override AbstractCalc.getCalcs().

        Parameters:
        exp - Source expression
      • GenericCalc

        protected GenericCalc​(Exp exp,
                              Calc[] calcs)
        Creates an GenericCalc.
        Parameters:
        exp - Source expression
        calcs - Child compiled expressions
    • Method Detail

      • evaluateTuple

        public Member[] evaluateTuple​(Evaluator evaluator)
        Description copied from interface: TupleCalc
        Evaluates this expression to yield a tuple.

        A tuple cannot contain any null members. If any of the members is null, this method must return a null.

        Specified by:
        evaluateTuple in interface TupleCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        an array of members, or null to represent the null tuple
      • evaluateString

        public String evaluateString​(Evaluator evaluator)
        Description copied from interface: StringCalc
        Evaluates this expression to yield a String value.
        Specified by:
        evaluateString in interface StringCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        evaluation result
      • evaluateInteger

        public int evaluateInteger​(Evaluator evaluator)
        Description copied from interface: IntegerCalc
        Evaluates this expression to yield an int value. If the result is null, returns the special FunUtil.IntegerNull value.
        Specified by:
        evaluateInteger in interface IntegerCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        evaluation result
      • evaluateDouble

        public double evaluateDouble​(Evaluator evaluator)
        Description copied from interface: DoubleCalc
        Evaluates this expression to yield a double value. If the result is null, returns the special FunUtil.DoubleNull value.
        Specified by:
        evaluateDouble in interface DoubleCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        evaluation result
      • numberToDouble

        public static double numberToDouble​(Number number)
      • evaluateBoolean

        public boolean evaluateBoolean​(Evaluator evaluator)
        Description copied from interface: BooleanCalc
        Evaluates this expression to yield a boolean value. If the result is null, returns the special FunUtil.BooleanNull value.
        Specified by:
        evaluateBoolean in interface BooleanCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        evaluation result
      • evaluateDateTime

        public Date evaluateDateTime​(Evaluator evaluator)
        Description copied from interface: DateTimeCalc
        Evaluates this expression to yield a Date value.
        Specified by:
        evaluateDateTime in interface DateTimeCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        evaluation result
      • evaluateLevel

        public Level evaluateLevel​(Evaluator evaluator)
        Description copied from interface: LevelCalc
        Evaluates this expression to yield a level.

        Never returns null.

        Specified by:
        evaluateLevel in interface LevelCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        a level
      • evaluateHierarchy

        public Hierarchy evaluateHierarchy​(Evaluator evaluator)
        Description copied from interface: HierarchyCalc
        Evaluates this expression to yield a hierarchy.

        Never returns null.

        Specified by:
        evaluateHierarchy in interface HierarchyCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        a hierarchy
      • evaluateDimension

        public Dimension evaluateDimension​(Evaluator evaluator)
        Description copied from interface: DimensionCalc
        Evaluates this expression to yield a dimension.

        Never returns null.

        Specified by:
        evaluateDimension in interface DimensionCalc
        Parameters:
        evaluator - Evaluation context
        Returns:
        a dimension