NumberValue based on BigDecimal.
| Modifier and Type | Field and Description |
|---|---|
| private final Number | number
The numeric value. |
| public static final NumberValue | ONE
The value 1, with a scale of 0. |
| private static final long | serialVersionUID
serialVersionUID.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public double | doubleValue()
Implements abstract java. Returns the value of the specified number as a |
| public double | doubleValueExact()
Implements abstract javax. Access the numeric value as |
| public float | floatValue()
Implements abstract java. Returns the value of the specified number as a |
| public long | getAmountFractionDenominator()
Implements abstract javax. This method allows to extract the denominator part of the current fraction, hereby given
|
| public long | getAmountFractionNumerator()
Implements abstract javax. This method allows to extract the numerator part of the current fraction, hereby given
|
| protected static BigDecimal | Returns: the correspondingBigDecimalthe number type num)
Deprecated
will be removed.
Creates a |
| public Class | getNumberType()
Implements abstract javax. Get the numeric implementation type, that is the base of this number. |
| public int | getPrecision()
Implements abstract javax. Returns the precision of this |
| public int | getScale()
Implements abstract javax. Returns the scale of this |
| public int | intValue()
Implements abstract java. Returns the value of the specified number as an |
| public int | intValueExact()
Implements abstract javax. Access the numeric value as |
| public long | longValue()
Implements abstract java. Returns the value of the specified number as a |
| public long | longValueExact()
Implements abstract javax. Access the numeric value as |
| public <T extends Number> T | numberValue(Class<T> numberType)
Implements abstract javax. Access the numeric value as |
| public <T extends Number> T | numberValueExact(Class<T> numberType)
Implements abstract javax. Access the numeric value as |
| public static NumberValue | Returns: A new instance ofNumberValue.The numeric part, not null. number)Creates a new instance of |
| public NumberValue | round(MathContext mathContext)
Implements abstract javax. Access the current NumberValue rounded using the given |
| public String |
| number | back to summary |
|---|---|
| private final Number number The numeric value. | |
| ONE | back to summary |
|---|---|
| public static final NumberValue ONE The value 1, with a scale of 0.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides javax. serialVersionUID. | |
| DefaultNumberValue | back to summary |
|---|---|
| public DefaultNumberValue(Number number) | |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Implements abstract java. Doc from java. Returns the value of the specified number as a
| |
| doubleValueExact | back to summary |
|---|---|
| public double doubleValueExact() Implements abstract javax. Doc from javax. Access the numeric value as
| |
| floatValue | back to summary |
|---|---|
| public float floatValue() Implements abstract java. Doc from java. Returns the value of the specified number as a
| |
| getAmountFractionDenominator | back to summary |
|---|---|
| public long getAmountFractionDenominator() Implements abstract javax. Doc from javax. This method allows to extract the denominator part of the current fraction, hereby given
the following must be always true:
.
| |
| getAmountFractionNumerator | back to summary |
|---|---|
| public long getAmountFractionNumerator() Implements abstract javax. Doc from javax. This method allows to extract the numerator part of the current fraction, hereby given
the following must be always true:
.
| |
| getBigDecimal | back to summary |
|---|---|
| protected static BigDecimal getBigDecimal(Number num)
Deprecated will be removed. Creates a
| |
| getNumberType | back to summary |
|---|---|
| public Class Implements abstract javax. Doc from javax. Get the numeric implementation type, that is the base of this number.
| |
| getPrecision | back to summary |
|---|---|
| public int getPrecision() Implements abstract javax. Doc from javax. Returns the precision of this The precision of a zero value is 1.
| |
| getScale | back to summary |
|---|---|
| public int getScale() Implements abstract javax. Doc from javax. Returns the scale of this
| |
| intValue | back to summary |
|---|---|
| public int intValue() Implements abstract java. Doc from java. Returns the value of the specified number as an
| |
| intValueExact | back to summary |
|---|---|
| public int intValueExact() Implements abstract javax. Doc from javax. Access the numeric value as
| |
| longValue | back to summary |
|---|---|
| public long longValue() Implements abstract java. Doc from java. Returns the value of the specified number as a
| |
| longValueExact | back to summary |
|---|---|
| public long longValueExact() Implements abstract javax. Doc from javax. Access the numeric value as
| |
| numberValue | back to summary |
|---|---|
| public <T extends Number> T numberValue(Class<T> numberType) Implements abstract javax. Doc from javax. Access the numeric value as
| |
| numberValueExact | back to summary |
|---|---|
| public <T extends Number> T numberValueExact(Class<T> numberType) Implements abstract javax. Doc from javax. Access the numeric value as
| |
| of | back to summary |
|---|---|
| public static NumberValue of(Number number) Creates a new instance of
| |
| round | back to summary |
|---|---|
| public NumberValue round(MathContext mathContext) Implements abstract javax. Doc from javax. Access the current NumberValue rounded using the given
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |