|
|||||||||
| Home >> All >> com >> lutris >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.lutris.util
Class Currency

java.lang.Objectjava.lang.Number
java.math.BigDecimal
com.lutris.util.Currency
- All Implemented Interfaces:
- java.lang.Comparable, java.io.Serializable
- public class Currency
- extends java.math.BigDecimal
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 |
| Fields inherited from class java.lang.Number |
|
| 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, add, compareTo, compareTo, divide, divide, doubleValue, equals, floatValue, hashCode, intValue, longValue, max, min, movePointLeft, movePointRight, multiply, negate, scale, setScale, setScale, signum, subtract, toBigInteger, unscaledValue, 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 |
Currency
public Currency()
- Construct a Currency object of value zero.
Currency
public Currency(java.math.BigDecimal value)
- Construct a Currency object from a BigDecimal or Currency object.
A null value result in an object containing zero.
Currency
public Currency(double value)
- Construct a Currency object from a double.
Currency
public Currency(float value)
- Construct a Currency object from a float.
Currency
public Currency(java.lang.String value)
- Construct a Currency object from a String.
| Method Detail |
equals
public boolean equals(float value)
- Check if equal to a float value.
equals
public boolean equals(double value)
- Check if equal to a double value.
add
public Currency add(Currency val)
- Returns a Currency whose value is (this + val).
subtract
public Currency subtract(Currency val)
- Returns a Currency whose value is (this - val).
multiply
public Currency multiply(Currency val)
- Returns a Currency whose value is (this * val)
multiply
public Currency multiply(int val)
- Returns a Currency whose value is (this * val)
divide
public Currency divide(Currency val) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
- Returns a Currency whose value is (this / val).
divide
public Currency divide(int val) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
- Returns a Currency whose value is (this / val).
absCurrency
public Currency absCurrency()
- Returns a Currency whose value is the absolute value of this
number.
negateCurrency
public Currency negateCurrency()
- Returns a Currency whose value is -1 * this.
toString
public java.lang.String toString()
- Convert to string with two decimals.
|
|||||||||
| Home >> All >> com >> lutris >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC