summaryrefslogtreecommitdiff
path: root/libjava/java/text/DecimalFormatSymbols.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-19 12:06:38 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-19 12:06:38 +0000
commit6fa8b2a2722fdd05f466a5886f72118edf88ef9e (patch)
treeefd1ae3135ad154661b80fde9e3378b0ad905389 /libjava/java/text/DecimalFormatSymbols.java
parentc44eb74c00740cf58ef27bcf5c11e5d7aaf2bfb6 (diff)
downloadgcc-6fa8b2a2722fdd05f466a5886f72118edf88ef9e.tar.gz
2003-11-19 Guilhem Lavaux <guilhem@kaffe.org>
Jim Pick <jim@kaffe.org> * java/text/DecimalFormat.java (getCurrency, setCurrency): New methods. 2003-11-19 Guilhem Lavaux <guilhem@kaffe.org> * java/text/DecimalFormatSymbols.java (getCurrency, setCurrency): New methods. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73735 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/text/DecimalFormatSymbols.java')
-rw-r--r--libjava/java/text/DecimalFormatSymbols.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/libjava/java/text/DecimalFormatSymbols.java b/libjava/java/text/DecimalFormatSymbols.java
index 2c1d971a649..1cb8f4f1769 100644
--- a/libjava/java/text/DecimalFormatSymbols.java
+++ b/libjava/java/text/DecimalFormatSymbols.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.text;
import java.io.Serializable;
+import java.util.Currency;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -195,6 +196,18 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
}
/**
+ * Returns the currency corresponding to the currency symbol stored
+ * in the instance of <code>DecimalFormatSymbols</code>.
+ *
+ * @return A new instance of <code>Currency</code> if
+ * the currency code matches a known one.
+ */
+ public Currency getCurrency ()
+ {
+ return Currency.getInstance (currencySymbol);
+ }
+
+ /**
* This method returns the currency symbol in local format. For example,
* "$" for Canadian dollars.
*
@@ -354,6 +367,16 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
}
/**
+ * This method sets the currency to the specified value.
+ *
+ * @param currency The new currency
+ */
+ public void setCurrency (Currency currency)
+ {
+ setCurrencySymbol (currency.getSymbol());
+ }
+
+ /**
* This method sets the currency symbol to the specified value.
*
* @param currencySymbol The new currency symbol