All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.Currency
java.lang.Object
|
+----semper.payment.Currency
- public class Currency
- extends Object
- implements Serializable, Cloneable
Class for representing different types of currency
- Version:
- $Revision: 1.15 $ $Date: 1998/01/28 12:42:33 $
- Author:
- N. Asokan ([email protected])
- See Also:
- Amount
-
UNKNOWN_CURRENCY
- Numeric code for unknown currencies
-
UNKNOWN_CURRENCY_STR
- 3-letter code for unknown currencies
-
Currency()
- Constructor without arguments
-
Currency(int)
- WARNING It is strongly recommended that you use th
Currency#Currency(java.lang.String) form of the constructor.
-
Currency(String)
- Constructor: Create a currency object given 3-letter ISO code.
-
clone()
- redefine clone so that anyone can make clones of us; this is
useful in accessor methods of other classes that have an object
of this class as an attribute.
-
equals(Currency)
-
redefine equals; note that we only compare the 3-letter currency codes;
numeric codes are irrelevant to us.
-
getAllCurrency()
- Get the a copy of CURRENCY-Hashtable, this can be used by a Purse
-
getISOCode()
- Get the 3-letter ISO code of the current Currency object.
-
getNumericCode()
- Get the internal numeric code for the current Currency object.
-
toString()
- redefine toString
UNKNOWN_CURRENCY
public final int UNKNOWN_CURRENCY
- Numeric code for unknown currencies
UNKNOWN_CURRENCY_STR
public final String UNKNOWN_CURRENCY_STR
- 3-letter code for unknown currencies
Currency
public Currency(String code)
- Constructor: Create a currency object given 3-letter ISO code.
If this is an unknown code, it will simply be stored as is.
- Parameters:
- code - 3-letter ISO code
- Returns:
- none
Currency
public Currency(int code) throws IllegalArgumentException
- WARNING It is strongly recommended that you use th
Currency#Currency(java.lang.String) form of the constructor.
Constructor: Create a currency object given a numeric ISO code. If this
is an unknown code, an exception is thrown.
- Parameters:
- integer - ISO code
- Throws: IllegalArgumentException
- if the numeric code is not known.
Currency
public Currency()
- Constructor without arguments
equals
public boolean equals(Currency other)
- redefine equals; note that we only compare the 3-letter currency codes;
numeric codes are irrelevant to us.
- Returns:
- true if objects are equal, false otherwise
- See Also:
- equals
toString
public String toString()
- redefine toString
- Returns:
- a string describing the currency
- Overrides:
- toString in class Object
- See Also:
- toString
clone
public synchronized Object clone()
- redefine clone so that anyone can make clones of us; this is
useful in accessor methods of other classes that have an object
of this class as an attribute.
- Overrides:
- clone in class Object
getAllCurrency
public static Hashtable getAllCurrency()
- Get the a copy of CURRENCY-Hashtable, this can be used by a Purse
- Returns:
- Hashtable of CURRENCY
getISOCode
public String getISOCode()
- Get the 3-letter ISO code of the current Currency object. For an
unknown currency, this will be whatever string that the creator
of the object set but transformed in uppercase letters.
- Returns:
- 3-letter ISO code for the currency
getNumericCode
public int getNumericCode()
- Get the internal numeric code for the current Currency object.
- Returns:
- internal numeric code of the currency
All Packages Class Hierarchy This Package Previous Next Index