Uses of Class
java.math.BigDecimal
-
Packages that use BigDecimal Package Description com.ibm.dataaccess java.math Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).java.sql Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java™ programming language.java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.javax.management.openmbean Provides the open data types and Open MBean descriptor classes.javax.sql Provides the API for server side data source access and processing from the Java™ programming language.javax.sql.rowset Standard interfaces and base classes for JDBCRowSetimplementations.javax.sql.rowset.serial Provides utility classes to allow serializable mappings between SQL types and data types in the Java programming language.javax.xml.datatype Defines XML/Java Type Mappings. -
-
Uses of BigDecimal in com.ibm.dataaccess
Methods in com.ibm.dataaccess that return BigDecimal Modifier and Type Method Description static BigDecimalDecimalData. convertExternalDecimalToBigDecimal(byte[] externalDecimal, int offset, int precision, int scale, boolean checkOverflow, int decimalType)Converts an External Decimal in a byte array to a BigDecimal.static BigDecimalDecimalData. convertPackedDecimalToBigDecimal(byte[] packedDecimal, int offset, int precision, int scale, boolean checkOverflow)Convert a Packed Decimal in a byte array to a BigDecimal.static BigDecimalDecimalData. convertUnicodeDecimalToBigDecimal(char[] unicodeDecimal, int offset, int precision, int scale, boolean checkOverflow, int decimalType)Converts a Unicode Decimal in a char array to a BigDecimal.Methods in com.ibm.dataaccess with parameters of type BigDecimal Modifier and Type Method Description static voidDecimalData. convertBigDecimalToExternalDecimal(BigDecimal bigDecimalValue, byte[] externalDecimal, int offset, int precision, boolean checkOverflow, int decimalType)Converts a BigDecimal value to an External Decimal in a byte array Overflow can happen if the BigDecimal does not fit into the result byte array.static voidDecimalData. convertBigDecimalToPackedDecimal(BigDecimal bigDecimalValue, byte[] packedDecimal, int offset, int precision, boolean checkOverflow)Converts a BigDecimal into a Packed Decimal in a byte array Overflow can happen if the BigDecimal does not fit into the result byte array.static voidDecimalData. convertBigDecimalToUnicodeDecimal(BigDecimal bigDecimalValue, char[] unicodeDecimal, int offset, int precision, boolean checkOverflow, int decimalType)Converts a BigDecimal value to a Unicode Decimal in a char array Overflow can happen if the BigDecimal does not fit into the result char array. -
Uses of BigDecimal in java.math
Fields in java.math declared as BigDecimal Modifier and Type Field Description static BigDecimalBigDecimal. ONEThe value 1, with a scale of 0.static BigDecimalBigDecimal. TENThe value 10, with a scale of 0.static BigDecimalBigDecimal. ZEROThe value 0, with a scale of 0.Methods in java.math that return BigDecimal Modifier and Type Method Description BigDecimalBigDecimal. abs()Returns aBigDecimalwhose value is the absolute value of thisBigDecimal, and whose scale isthis.scale().BigDecimalBigDecimal. abs(MathContext mc)Returns aBigDecimalwhose value is the absolute value of thisBigDecimal, with rounding according to the context settings.BigDecimalBigDecimal. add(BigDecimal augend)Returns aBigDecimalwhose value is(this + augend), and whose scale ismax(this.scale(), augend.scale()).BigDecimalBigDecimal. add(BigDecimal augend, MathContext mc)Returns aBigDecimalwhose value is(this + augend), with rounding according to the context settings.BigDecimalBigDecimal. divide(BigDecimal divisor)Returns aBigDecimalwhose value is(this / divisor), and whose preferred scale is(this.scale() - divisor.scale()); if the exact quotient cannot be represented (because it has a non-terminating decimal expansion) anArithmeticExceptionis thrown.BigDecimalBigDecimal. divide(BigDecimal divisor, int roundingMode)Deprecated.The methoddivide(BigDecimal, RoundingMode)should be used in preference to this legacy method.BigDecimalBigDecimal. divide(BigDecimal divisor, int scale, int roundingMode)Deprecated.The methoddivide(BigDecimal, int, RoundingMode)should be used in preference to this legacy method.BigDecimalBigDecimal. divide(BigDecimal divisor, int scale, RoundingMode roundingMode)Returns aBigDecimalwhose value is(this / divisor), and whose scale is as specified.BigDecimalBigDecimal. divide(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is(this / divisor), with rounding according to the context settings.BigDecimalBigDecimal. divide(BigDecimal divisor, RoundingMode roundingMode)Returns aBigDecimalwhose value is(this / divisor), and whose scale isthis.scale().BigDecimal[]BigDecimal. divideAndRemainder(BigDecimal divisor)Returns a two-elementBigDecimalarray containing the result ofdivideToIntegralValuefollowed by the result ofremainderon the two operands.BigDecimal[]BigDecimal. divideAndRemainder(BigDecimal divisor, MathContext mc)Returns a two-elementBigDecimalarray containing the result ofdivideToIntegralValuefollowed by the result ofremainderon the two operands calculated with rounding according to the context settings.BigDecimalBigDecimal. divideToIntegralValue(BigDecimal divisor)Returns aBigDecimalwhose value is the integer part of the quotient(this / divisor)rounded down.BigDecimalBigDecimal. divideToIntegralValue(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is the integer part of(this / divisor).BigDecimalBigDecimal. max(BigDecimal val)Returns the maximum of thisBigDecimalandval.BigDecimalBigDecimal. min(BigDecimal val)Returns the minimum of thisBigDecimalandval.BigDecimalBigDecimal. movePointLeft(int n)Returns aBigDecimalwhich is equivalent to this one with the decimal point movednplaces to the left.BigDecimalBigDecimal. movePointRight(int n)Returns aBigDecimalwhich is equivalent to this one with the decimal point movednplaces to the right.BigDecimalBigDecimal. multiply(BigDecimal multiplicand)Returns aBigDecimalwhose value is(this × multiplicand), and whose scale is(this.scale() + multiplicand.scale()).BigDecimalBigDecimal. multiply(BigDecimal multiplicand, MathContext mc)Returns aBigDecimalwhose value is(this × multiplicand), with rounding according to the context settings.BigDecimalBigDecimal. negate()Returns aBigDecimalwhose value is(-this), and whose scale isthis.scale().BigDecimalBigDecimal. negate(MathContext mc)Returns aBigDecimalwhose value is(-this), with rounding according to the context settings.BigDecimalBigDecimal. plus()Returns aBigDecimalwhose value is(+this), and whose scale isthis.scale().BigDecimalBigDecimal. plus(MathContext mc)Returns aBigDecimalwhose value is(+this), with rounding according to the context settings.BigDecimalBigDecimal. pow(int n)Returns aBigDecimalwhose value is(thisn), The power is computed exactly, to unlimited precision.BigDecimalBigDecimal. pow(int n, MathContext mc)Returns aBigDecimalwhose value is(thisn).BigDecimalBigDecimal. remainder(BigDecimal divisor)Returns aBigDecimalwhose value is(this % divisor).BigDecimalBigDecimal. remainder(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is(this % divisor), with rounding according to the context settings.BigDecimalBigDecimal. round(MathContext mc)Returns aBigDecimalrounded according to theMathContextsettings.BigDecimalBigDecimal. scaleByPowerOfTen(int n)Returns a BigDecimal whose numerical value is equal to (this* 10n).BigDecimalBigDecimal. setScale(int newScale)Returns aBigDecimalwhose scale is the specified value, and whose value is numerically equal to thisBigDecimal's.BigDecimalBigDecimal. setScale(int newScale, int roundingMode)Deprecated.The methodsetScale(int, RoundingMode)should be used in preference to this legacy method.BigDecimalBigDecimal. setScale(int newScale, RoundingMode roundingMode)Returns aBigDecimalwhose scale is the specified value, and whose unscaled value is determined by multiplying or dividing thisBigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.BigDecimalBigDecimal. sqrt(MathContext mc)Returns an approximation to the square root ofthiswith rounding according to the context settings.BigDecimalBigDecimal. stripTrailingZeros()Returns aBigDecimalwhich is numerically equal to this one but with any trailing zeros removed from the representation.BigDecimalBigDecimal. subtract(BigDecimal subtrahend)Returns aBigDecimalwhose value is(this - subtrahend), and whose scale ismax(this.scale(), subtrahend.scale()).BigDecimalBigDecimal. subtract(BigDecimal subtrahend, MathContext mc)Returns aBigDecimalwhose value is(this - subtrahend), with rounding according to the context settings.BigDecimalBigDecimal. ulp()Returns the size of an ulp, a unit in the last place, of thisBigDecimal.static BigDecimalBigDecimal. valueOf(double val)Translates adoubleinto aBigDecimal, using thedouble's canonical string representation provided by theDouble.toString(double)method.static BigDecimalBigDecimal. valueOf(long val)Translates alongvalue into aBigDecimalwith a scale of zero.static BigDecimalBigDecimal. valueOf(long unscaledVal, int scale)Translates alongunscaled value and anintscale into aBigDecimal.Methods in java.math with parameters of type BigDecimal Modifier and Type Method Description BigDecimalBigDecimal. add(BigDecimal augend)Returns aBigDecimalwhose value is(this + augend), and whose scale ismax(this.scale(), augend.scale()).BigDecimalBigDecimal. add(BigDecimal augend, MathContext mc)Returns aBigDecimalwhose value is(this + augend), with rounding according to the context settings.intBigDecimal. compareTo(BigDecimal val)Compares thisBigDecimalwith the specifiedBigDecimal.BigDecimalBigDecimal. divide(BigDecimal divisor)Returns aBigDecimalwhose value is(this / divisor), and whose preferred scale is(this.scale() - divisor.scale()); if the exact quotient cannot be represented (because it has a non-terminating decimal expansion) anArithmeticExceptionis thrown.BigDecimalBigDecimal. divide(BigDecimal divisor, int roundingMode)Deprecated.The methoddivide(BigDecimal, RoundingMode)should be used in preference to this legacy method.BigDecimalBigDecimal. divide(BigDecimal divisor, int scale, int roundingMode)Deprecated.The methoddivide(BigDecimal, int, RoundingMode)should be used in preference to this legacy method.BigDecimalBigDecimal. divide(BigDecimal divisor, int scale, RoundingMode roundingMode)Returns aBigDecimalwhose value is(this / divisor), and whose scale is as specified.BigDecimalBigDecimal. divide(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is(this / divisor), with rounding according to the context settings.BigDecimalBigDecimal. divide(BigDecimal divisor, RoundingMode roundingMode)Returns aBigDecimalwhose value is(this / divisor), and whose scale isthis.scale().BigDecimal[]BigDecimal. divideAndRemainder(BigDecimal divisor)Returns a two-elementBigDecimalarray containing the result ofdivideToIntegralValuefollowed by the result ofremainderon the two operands.BigDecimal[]BigDecimal. divideAndRemainder(BigDecimal divisor, MathContext mc)Returns a two-elementBigDecimalarray containing the result ofdivideToIntegralValuefollowed by the result ofremainderon the two operands calculated with rounding according to the context settings.BigDecimalBigDecimal. divideToIntegralValue(BigDecimal divisor)Returns aBigDecimalwhose value is the integer part of the quotient(this / divisor)rounded down.BigDecimalBigDecimal. divideToIntegralValue(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is the integer part of(this / divisor).BigDecimalBigDecimal. max(BigDecimal val)Returns the maximum of thisBigDecimalandval.BigDecimalBigDecimal. min(BigDecimal val)Returns the minimum of thisBigDecimalandval.BigDecimalBigDecimal. multiply(BigDecimal multiplicand)Returns aBigDecimalwhose value is(this × multiplicand), and whose scale is(this.scale() + multiplicand.scale()).BigDecimalBigDecimal. multiply(BigDecimal multiplicand, MathContext mc)Returns aBigDecimalwhose value is(this × multiplicand), with rounding according to the context settings.BigDecimalBigDecimal. remainder(BigDecimal divisor)Returns aBigDecimalwhose value is(this % divisor).BigDecimalBigDecimal. remainder(BigDecimal divisor, MathContext mc)Returns aBigDecimalwhose value is(this % divisor), with rounding according to the context settings.BigDecimalBigDecimal. subtract(BigDecimal subtrahend)Returns aBigDecimalwhose value is(this - subtrahend), and whose scale ismax(this.scale(), subtrahend.scale()).BigDecimalBigDecimal. subtract(BigDecimal subtrahend, MathContext mc)Returns aBigDecimalwhose value is(this - subtrahend), with rounding according to the context settings. -
Uses of BigDecimal in java.sql
Methods in java.sql that return BigDecimal Modifier and Type Method Description BigDecimalCallableStatement. getBigDecimal(int parameterIndex)Retrieves the value of the designated JDBCNUMERICparameter as ajava.math.BigDecimalobject with as many digits to the right of the decimal point as the value contains.BigDecimalCallableStatement. getBigDecimal(int parameterIndex, int scale)Deprecated.usegetBigDecimal(int parameterIndex)orgetBigDecimal(String parameterName)BigDecimalCallableStatement. getBigDecimal(String parameterName)Retrieves the value of a JDBCNUMERICparameter as ajava.math.BigDecimalobject with as many digits to the right of the decimal point as the value contains.BigDecimalResultSet. getBigDecimal(int columnIndex)Retrieves the value of the designated column in the current row of thisResultSetobject as ajava.math.BigDecimalwith full precision.BigDecimalResultSet. getBigDecimal(int columnIndex, int scale)Deprecated.UsegetBigDecimal(int columnIndex)orgetBigDecimal(String columnLabel)BigDecimalResultSet. getBigDecimal(String columnLabel)Retrieves the value of the designated column in the current row of thisResultSetobject as ajava.math.BigDecimalwith full precision.BigDecimalResultSet. getBigDecimal(String columnLabel, int scale)Deprecated.UsegetBigDecimal(int columnIndex)orgetBigDecimal(String columnLabel)BigDecimalSQLInput. readBigDecimal()Reads the next attribute in the stream and returns it as ajava.math.BigDecimalobject in the Java programming language.Methods in java.sql with parameters of type BigDecimal Modifier and Type Method Description voidCallableStatement. setBigDecimal(String parameterName, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidPreparedStatement. setBigDecimal(int parameterIndex, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidResultSet. updateBigDecimal(int columnIndex, BigDecimal x)Updates the designated column with ajava.math.BigDecimalvalue.voidResultSet. updateBigDecimal(String columnLabel, BigDecimal x)Updates the designated column with ajava.sql.BigDecimalvalue.voidSQLOutput. writeBigDecimal(BigDecimal x)Writes the next attribute to the stream as a java.math.BigDecimal object. -
Uses of BigDecimal in java.util
Methods in java.util that return BigDecimal Modifier and Type Method Description BigDecimalScanner. nextBigDecimal()Scans the next token of the input as aBigDecimal. -
Uses of BigDecimal in javax.management.openmbean
Fields in javax.management.openmbean with type parameters of type BigDecimal Modifier and Type Field Description static SimpleType<BigDecimal>SimpleType. BIGDECIMALTheSimpleTypeinstance describing values whose Java class name isjava.math.BigDecimal. -
Uses of BigDecimal in javax.sql
Methods in javax.sql with parameters of type BigDecimal Modifier and Type Method Description voidRowSet. setBigDecimal(int parameterIndex, BigDecimal x)Sets the designated parameter in thisRowSetobject's command to the givenjava.math.BigDecimalvalue.voidRowSet. setBigDecimal(String parameterName, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue. -
Uses of BigDecimal in javax.sql.rowset
Methods in javax.sql.rowset with parameters of type BigDecimal Modifier and Type Method Description voidBaseRowSet. setBigDecimal(int parameterIndex, BigDecimal x)Sets the designated parameter to the givenjava.lang.BigDecimalvalue.voidBaseRowSet. setBigDecimal(String parameterName, BigDecimal x)Sets the designated parameter to the givenjava.math.BigDecimalvalue. -
Uses of BigDecimal in javax.sql.rowset.serial
Methods in javax.sql.rowset.serial that return BigDecimal Modifier and Type Method Description BigDecimalSQLInputImpl. readBigDecimal()Retrieves the next attribute in thisSQLInputImplobject as ajava.math.BigDecimal.Methods in javax.sql.rowset.serial with parameters of type BigDecimal Modifier and Type Method Description voidSQLOutputImpl. writeBigDecimal(BigDecimal x)Writes ajava.math.BigDecimalobject in the Java programming language to thisSQLOutputImplobject. -
Uses of BigDecimal in javax.xml.datatype
Methods in javax.xml.datatype that return BigDecimal Modifier and Type Method Description abstract BigDecimalXMLGregorianCalendar. getFractionalSecond()Returns fractional seconds.Methods in javax.xml.datatype with parameters of type BigDecimal Modifier and Type Method Description abstract DurationDuration. multiply(BigDecimal factor)Computes a new duration whose value isfactortimes longer than the value of this duration.abstract DurationDatatypeFactory. newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds)Obtain a new instance of aDurationspecifying theDurationas isPositive, years, months, days, hours, minutes, seconds.abstract XMLGregorianCalendarDatatypeFactory. newXMLGregorianCalendar(BigInteger year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond, int timezone)Constructor allowing for complete value spaces allowed by W3C XML Schema 1.0 recommendation for xsd:dateTime and related builtin datatypes.XMLGregorianCalendarDatatypeFactory. newXMLGregorianCalendarTime(int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone)Create a Java instance of XML Schema builtin datatype time.abstract voidXMLGregorianCalendar. setFractionalSecond(BigDecimal fractional)Set fractional seconds.voidXMLGregorianCalendar. setTime(int hour, int minute, int second, BigDecimal fractional)Set time as one unit, including the optional infinite precision fractional seconds.
-