|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
java.math.BigDecimal
com.lutris.util.Currency
public class Currency
Object to store and manipulate money.
Field Summary |
---|
Fields inherited from class java.math.BigDecimal |
---|
ONE, ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UNNECESSARY, ROUND_UP, TEN, ZERO |
Constructor Summary | |
---|---|
Currency()
Construct a Currency object of value zero. |
|
Currency(java.math.BigDecimal value)
Construct a Currency object from a BigDecimal or Currency object. |
|
Currency(double value)
Construct a Currency object from a double. |
|
Currency(float value)
Construct a Currency object from a float. |
|
Currency(java.lang.String value)
Construct a Currency object from a String. |
Method Summary | |
---|---|
Currency |
absCurrency()
Returns a Currency whose value is the absolute value of this number. |
Currency |
add(Currency val)
Returns a Currency whose value is (this + val). |
Currency |
divide(Currency val)
Returns a Currency whose value is (this / val). |
Currency |
divide(int val)
Returns a Currency whose value is (this / val). |
boolean |
equals(double value)
Check if equal to a double value. |
boolean |
equals(float value)
Check if equal to a float value. |
Currency |
multiply(Currency val)
Returns a Currency whose value is (this * val) |
Currency |
multiply(int val)
Returns a Currency whose value is (this * val) |
Currency |
negateCurrency()
Returns a Currency whose value is -1 * this. |
Currency |
subtract(Currency val)
Returns a Currency whose value is (this - val). |
java.lang.String |
toString()
Convert to string with two decimals. |
Methods inherited from class java.math.BigDecimal |
---|
abs, abs, add, add, byteValueExact, compareTo, divide, divide, divide, divide, divide, divide, divideAndRemainder, divideAndRemainder, divideToIntegralValue, divideToIntegralValue, doubleValue, equals, floatValue, hashCode, intValue, intValueExact, longValue, longValueExact, max, min, movePointLeft, movePointRight, multiply, multiply, negate, negate, plus, plus, pow, pow, precision, remainder, remainder, round, scale, scaleByPowerOfTen, setScale, setScale, setScale, shortValueExact, signum, stripTrailingZeros, subtract, subtract, toBigInteger, toBigIntegerExact, toEngineeringString, toPlainString, ulp, unscaledValue, valueOf, valueOf, valueOf |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Currency()
public Currency(java.math.BigDecimal value)
public Currency(double value)
public Currency(float value)
public Currency(java.lang.String value)
Method Detail |
---|
public boolean equals(float value)
public boolean equals(double value)
public Currency add(Currency val)
public Currency subtract(Currency val)
public Currency multiply(Currency val)
public Currency multiply(int val)
public Currency divide(Currency val) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
java.lang.ArithmeticException
java.lang.IllegalArgumentException
public Currency divide(int val) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
java.lang.ArithmeticException
java.lang.IllegalArgumentException
public Currency absCurrency()
public Currency negateCurrency()
public java.lang.String toString()
toString
in class java.math.BigDecimal
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |