Interface NumberDataValue

    • Field Detail

      • MIN_DECIMAL_DIVIDE_SCALE

        static final int MIN_DECIMAL_DIVIDE_SCALE
        The minimum scale when dividing Decimals
        See Also:
        Constant Field Values
      • MAX_DECIMAL_PRECISION_SCALE

        static final int MAX_DECIMAL_PRECISION_SCALE
        See Also:
        Constant Field Values
    • Method Detail

      • divide

        NumberDataValue divide​(NumberDataValue dividend,
                               NumberDataValue divisor,
                               NumberDataValue result,
                               int scale)
                        throws StandardException
        The SQL / operator.
        Parameters:
        dividend - The numerator
        divisor - The denominator
        result - The result of the previous call to this method, null if not called yet.
        scale - The scale of the result, for decimal type. If pass in value < 0, can calculate it dynamically.
        Returns:
        dividend / divisor
        Throws:
        StandardException - Thrown on error, if result is non-null then its value will be unchanged.
      • minus

        NumberDataValue minus​(NumberDataValue result)
                       throws StandardException
        The SQL unary - operator. Negates this NumberDataValue.
        Parameters:
        result - The result of the previous call to this method, null if not called yet.
        Returns:
        - operand
        Throws:
        StandardException - Thrown on error, if result is non-null then its value will be unchanged.
      • absolute

        NumberDataValue absolute​(NumberDataValue result)
                          throws StandardException
        The SQL ABSOLUTE operator. Absolute value of this NumberDataValue.
        Parameters:
        result - The result of the previous call to this method, null if not called yet.
        Throws:
        StandardException - Thrown on error, if result is non-null then its value will be unchanged.
      • sqrt

        NumberDataValue sqrt​(NumberDataValue result)
                      throws StandardException
        The SQL SQRT operator. Sqrt value of this NumberDataValue.
        Parameters:
        result - The result of the previous call to this method, null if not call yet.
        Throws:
        StandardException - Thrown on error (a negative number), if result is non-null then its value will be unchanged.
      • setValue

        void setValue​(java.lang.Number theValue)
               throws StandardException
        Set the value of this NumberDataValue to the given value. This is only intended to be called when mapping values from the Java space into the SQL space, e.g. parameters and return types from procedures and functions. Each specific type is only expected to handle the explicit type according the JDBC.
        • SMALLINT from java.lang.Integer
        • INTEGER from java.lang.Integer
        • LONG from java.lang.Long
        • FLOAT from java.lang.Float
        • DOUBLE from java.lang.Double
        • DECIMAL from java.math.BigDecimal
        Parameters:
        theValue - An Number containing the value to set this NumberDataValue to. Null means set the value to SQL null.
        Throws:
        StandardException