|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.weft.dbutil.Currency
An amount of money. Most world currencies are now 'decimal' with a larger denomination unit which is on hundred times the value of the smaller denomination unit: e.g. dollars and cents, pounds and pennies, etc. It makes sense to store these in the database as an integer number of the smaller denomination unit. This class represents part of the support for that.
| Field Summary | |
static int |
defaultCurrency
the currency which is the default on this system |
static int |
EURO
symbolic values for some well known currencies - generally, the international dialling code for the country in which the central bank for that currency is located. |
static int |
STERLING
symbolic values for some well known currencies - generally, the international dialling code for the country in which the central bank for that currency is located. |
static int |
USDOLLAR
symbolic values for some well known currencies - generally, the international dialling code for the country in which the central bank for that currency is located. |
static int |
YEN
symbolic values for some well known currencies - generally, the international dialling code for the country in which the central bank for that currency is located. |
| Constructor Summary | |
Currency()
create an 'empty' (zero) sum of money |
|
Currency(double pounds)
Creates a new Currency object. |
|
Currency(double pounds,
int currency)
TODO well unsafe! Fix this! |
|
Currency(int pennies)
create a new amount of money, currency whatever is the default for this system |
|
Currency(int pennies,
int currency)
create a new amount of this currency |
|
| Method Summary | |
java.lang.Double |
coerceToDouble()
Deprecated. this isn't really safe because of possible rounding errors |
java.lang.Integer |
coerceToInteger()
|
java.lang.String |
getSymbolAsEntity()
|
java.lang.String |
toString()
|
java.lang.String |
toString(boolean withSymbol)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int STERLING
public static final int USDOLLAR
public static final int EURO
public static final int YEN
public static int defaultCurrency
| Constructor Detail |
public Currency()
public Currency(int pennies)
throws DataFormatException
public Currency(int pennies,
int currency)
throws DataFormatException
public Currency(double pounds)
throws DataFormatException
pounds - DOCUMENT ME!
DataFormatException - DOCUMENT ME!
public Currency(double pounds,
int currency)
throws DataFormatException
| Method Detail |
public java.lang.String getSymbolAsEntity()
public java.lang.Integer coerceToInteger()
public java.lang.Double coerceToDouble()
public java.lang.String toString()
public java.lang.String toString(boolean withSymbol)
withSymbol - if true prefix my value with my symbol as an HTML
entity
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||