Class Calculator.DecimalDivDecimal

  • Enclosing class:
    Calculator

    public static class Calculator.DecimalDivDecimal
    extends Calculator
    Arithmetic: decimal div decimal (including types that promote to decimal, that is, integer)
    • Constructor Detail

      • DecimalDivDecimal

        public DecimalDivDecimal()
    • Method Detail

      • compute

        public AtomicValue compute​(AtomicValue a,
                                   AtomicValue b,
                                   XPathContext c)
                            throws XPathException
        Description copied from class: Calculator
        Perform an arithmetic operation
        Specified by:
        compute in class Calculator
        Parameters:
        a - the first operand. Must not be null, and must be an instance of the type implied by the class name.
        b - the second operand. Must not be null, and must be an instance of the type implied by the class name.
        c - the XPath dynamic evaluation context
        Returns:
        the result of the computation, as a value of the correct primitive type
        Throws:
        XPathException - in the event of an arithmetic error
      • getResultType

        public AtomicType getResultType​(AtomicType typeA,
                                        AtomicType typeB)
        Description copied from class: Calculator
        Get the type of the result of the calculator, given arguments types typeA and typeB
        Specified by:
        getResultType in class Calculator
        Parameters:
        typeA - the type of the first operand
        typeB - the type of the second operand
        Returns:
        the type of the result