final class LongConversion extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
longToUnscaled(ScaleMetrics scaleMetrics,
long value)
Converts the specified long value to an unscaled value of the scale
defined by the given
scaleMetrics. |
static long |
longToUnscaledUnchecked(ScaleMetrics scaleMetrics,
long value)
Converts the specified long value to an unscaled value of the scale
defined by the given
scaleMetrics. |
static long |
unscaledToLong(ScaleMetrics scaleMetrics,
DecimalRounding rounding,
long uDecimal)
Converts the specified unscaled value to a long rounding the result if
necessary.
|
static long |
unscaledToLong(ScaleMetrics scaleMetrics,
long uDecimal)
Converts the specified unscaled value to a long truncating the result if
necessary.
|
public static final long longToUnscaledUnchecked(ScaleMetrics scaleMetrics, long value)
scaleMetrics. Performs no overflow checks.scaleMetrics - the scale metrics defining the result scalevalue - the long value to convertscaleMetricspublic static final long longToUnscaled(ScaleMetrics scaleMetrics, long value)
scaleMetrics. An exception is thrown if an
overflow occurs.scaleMetrics - the scale metrics defining the result scalevalue - the long value to convertscaleMetricsIllegalArgumentException - if value is too large to be represented as a Decimal
with the scale of this factorypublic static final long unscaledToLong(ScaleMetrics scaleMetrics, long uDecimal)
scaleMetrics - the scale metrics associated with uDecimaluDecimal - the unscaled decimal value to convertpublic static final long unscaledToLong(ScaleMetrics scaleMetrics, DecimalRounding rounding, long uDecimal)
scaleMetrics - the scale metrics associated with uDecimalrounding - the rounding to apply during the conversion if necessaryuDecimal - the unscaled decimal value to convertArithmeticException - if roundingMode==UNNECESSARY and rounding is
necessary