public final class DefaultNumberValue extends javax.money.NumberValue
NumberValue based on BigDecimal.| Modifier and Type | Field and Description |
|---|---|
static javax.money.NumberValue |
ONE
The value 1, with a scale of 0.
|
| Constructor and Description |
|---|
DefaultNumberValue(Number number) |
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue() |
double |
doubleValueExact() |
float |
floatValue() |
long |
getAmountFractionDenominator() |
long |
getAmountFractionNumerator() |
protected static BigDecimal |
getBigDecimal(Number num)
Creates a
BigDecimal from the given Number doing the valid conversion
depending the type given. |
Class<?> |
getNumberType() |
int |
getPrecision() |
int |
getScale() |
int |
intValue() |
int |
intValueExact() |
long |
longValue() |
long |
longValueExact() |
<T extends Number> |
numberValue(Class<T> numberType) |
<T extends Number> |
numberValueExact(Class<T> numberType) |
static javax.money.NumberValue |
of(Number number)
Creates a new instance of
NumberValue, using the given number. |
javax.money.NumberValue |
round(MathContext mathContext) |
String |
toString() |
byteValue, shortValuepublic static final javax.money.NumberValue ONE
BigDecimal.ONEpublic DefaultNumberValue(Number number)
public static javax.money.NumberValue of(Number number)
NumberValue, using the given number.number - The numeric part, not null.NumberValue.public Class<?> getNumberType()
getNumberType in class javax.money.NumberValuepublic int getPrecision()
getPrecision in class javax.money.NumberValuepublic int getScale()
getScale in class javax.money.NumberValuepublic int intValueExact()
intValueExact in class javax.money.NumberValuepublic long longValueExact()
longValueExact in class javax.money.NumberValuepublic float floatValue()
floatValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic double doubleValueExact()
doubleValueExact in class javax.money.NumberValuepublic long getAmountFractionNumerator()
getAmountFractionNumerator in class javax.money.NumberValuepublic long getAmountFractionDenominator()
getAmountFractionDenominator in class javax.money.NumberValuepublic <T extends Number> T numberValue(Class<T> numberType)
numberValue in class javax.money.NumberValuepublic javax.money.NumberValue round(MathContext mathContext)
round in class javax.money.NumberValuepublic <T extends Number> T numberValueExact(Class<T> numberType)
numberValueExact in class javax.money.NumberValueprotected static BigDecimal getBigDecimal(Number num)
BigDecimal from the given Number doing the valid conversion
depending the type given.num - the number typeBigDecimalCopyright © 2012-2015 JavaMoney. All Rights Reserved.