public class Money extends Object
integer part
and decimal part
of the value without loss of information.
bigDecimalValue()
returns the value without loss of information
doubleValue()
()} returns the value possible loss of informationConstructor and Description |
---|
Money() |
Money(long integerPart,
int decimalPart) |
Money(Number value) |
Modifier and Type | Method and Description |
---|---|
BigDecimal |
bigDecimalValue() |
double |
doubleValue() |
boolean |
equals(Object o) |
int |
getDecimalPart() |
long |
getIntegerPart() |
int |
hashCode() |
Money |
setDecimalPart(int part)
Set the decimal part of the monetary value.
|
Money |
setIntegerPart(long part)
Set the integer part of the monetary value.
|
String |
toString() |
public Money(long integerPart, int decimalPart)
public Money(Number value)
public Money()
public long getIntegerPart()
public int getDecimalPart()
public Money setIntegerPart(long part)
This value must belong to the range ]Long.MAX_VALUE / 100, Long.MIN_VALUE / 100[
part
- the integer part of the valuepublic Money setDecimalPart(int part)
This value must belong to the range [0, 100]
part
- decimal partpublic BigDecimal bigDecimalValue()
public double doubleValue()
Copyright © 2023 Eclipse. All rights reserved.