public final class DecimalDataUtils extends Object
DecimalData
.
Note: we have to put this class under the same package with DecimalData
to make it
possible to access package-accessing member variables.
Modifier and Type | Field and Description |
---|---|
static DecimalType |
DECIMAL_SYSTEM_DEFAULT |
Constructor and Description |
---|
DecimalDataUtils() |
Modifier and Type | Method and Description |
---|---|
static DecimalData |
abs(DecimalData decimal) |
static DecimalData |
add(DecimalData v1,
DecimalData v2,
int precision,
int scale) |
static DecimalData |
castFrom(boolean val,
int p,
int s) |
static DecimalData |
castFrom(DecimalData dec,
int precision,
int scale) |
static DecimalData |
castFrom(double val,
int p,
int s) |
static DecimalData |
castFrom(long val,
int p,
int s) |
static DecimalData |
castFrom(String string,
int precision,
int scale) |
static boolean |
castToBoolean(DecimalData dec) |
static byte |
castToByte(DecimalData dec) |
static DecimalData |
castToDecimal(DecimalData dec,
int precision,
int scale) |
static double |
castToDouble(DecimalData dec) |
static float |
castToFloat(DecimalData dec) |
static int |
castToInt(DecimalData dec) |
static long |
castToIntegral(DecimalData dec) |
static long |
castToLong(DecimalData dec) |
static short |
castToShort(DecimalData dec) |
static long |
castToTimestamp(DecimalData dec) |
static DecimalData |
ceil(DecimalData decimal) |
static int |
compare(DecimalData b1,
DecimalData b2) |
static int |
compare(DecimalData b1,
double n2) |
static int |
compare(DecimalData b1,
long n2) |
static int |
compare(double n1,
DecimalData b2) |
static int |
compare(long n1,
DecimalData b2) |
static DecimalData |
divide(DecimalData v1,
DecimalData v2,
int precision,
int scale) |
static DecimalData |
divideToIntegralValue(DecimalData value,
DecimalData divisor,
int precision,
int scale)
Returns a
DecimalData whose value is the integer part of the quotient (this /
divisor) rounded down. |
static double |
doubleValue(DecimalData decimal) |
static DecimalData |
floor(DecimalData decimal) |
static boolean |
is32BitDecimal(int precision) |
static boolean |
is64BitDecimal(int precision) |
static boolean |
isByteArrayDecimal(int precision) |
static DecimalData |
mod(DecimalData v1,
DecimalData v2,
int precision,
int scale) |
static DecimalData |
multiply(DecimalData v1,
DecimalData v2,
int precision,
int scale) |
static DecimalData |
negate(DecimalData decimal) |
static long |
power10(int n) |
static DecimalData |
sign(DecimalData b0)
SQL
SIGN operator applied to BigDecimal values. |
static int |
signum(DecimalData decimal)
Returns the signum function of this decimal.
|
static DecimalData |
sround(DecimalData b0,
int r)
SQL
ROUND operator applied to BigDecimal values. |
static DecimalData |
subtract(DecimalData v1,
DecimalData v2,
int precision,
int scale) |
public static final DecimalType DECIMAL_SYSTEM_DEFAULT
public static double doubleValue(DecimalData decimal)
public static int signum(DecimalData decimal)
public static DecimalData negate(DecimalData decimal)
public static DecimalData abs(DecimalData decimal)
public static DecimalData floor(DecimalData decimal)
public static DecimalData ceil(DecimalData decimal)
public static DecimalData add(DecimalData v1, DecimalData v2, int precision, int scale)
public static DecimalData subtract(DecimalData v1, DecimalData v2, int precision, int scale)
public static DecimalData multiply(DecimalData v1, DecimalData v2, int precision, int scale)
public static DecimalData divide(DecimalData v1, DecimalData v2, int precision, int scale)
public static DecimalData mod(DecimalData v1, DecimalData v2, int precision, int scale)
public static DecimalData divideToIntegralValue(DecimalData value, DecimalData divisor, int precision, int scale)
DecimalData
whose value is the integer part of the quotient (this /
divisor)
rounded down.value
- value by which this DecimalData
is to be divided.divisor
- value by which this DecimalData
is to be divided.this / divisor
.ArithmeticException
- if divisor==0
public static long castToIntegral(DecimalData dec)
public static long castToLong(DecimalData dec)
public static int castToInt(DecimalData dec)
public static short castToShort(DecimalData dec)
public static byte castToByte(DecimalData dec)
public static float castToFloat(DecimalData dec)
public static double castToDouble(DecimalData dec)
public static DecimalData castToDecimal(DecimalData dec, int precision, int scale)
public static boolean castToBoolean(DecimalData dec)
public static long castToTimestamp(DecimalData dec)
public static DecimalData castFrom(DecimalData dec, int precision, int scale)
public static DecimalData castFrom(String string, int precision, int scale)
public static DecimalData castFrom(double val, int p, int s)
public static DecimalData castFrom(long val, int p, int s)
public static DecimalData castFrom(boolean val, int p, int s)
public static DecimalData sign(DecimalData b0)
SIGN
operator applied to BigDecimal values. preserve precision and scale.public static int compare(DecimalData b1, DecimalData b2)
public static int compare(DecimalData b1, long n2)
public static int compare(DecimalData b1, double n2)
public static int compare(long n1, DecimalData b2)
public static int compare(double n1, DecimalData b2)
public static DecimalData sround(DecimalData b0, int r)
ROUND
operator applied to BigDecimal values.public static long power10(int n)
public static boolean is32BitDecimal(int precision)
public static boolean is64BitDecimal(int precision)
public static boolean isByteArrayDecimal(int precision)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.