NumberFormat.java: Sorted imports.
authorMichael Koch <konqueror@gmx.de>
Fri, 19 Dec 2003 10:00:02 +0000 (10:00 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Fri, 19 Dec 2003 10:00:02 +0000 (10:00 +0000)
2003-12-19  Michael Koch  <konqueror@gmx.de>

* java/text/NumberFormat.java: Sorted imports.
(getCurrency): New method.
(setCurrency): New method.

From-SVN: r74830

libjava/ChangeLog
libjava/java/text/NumberFormat.java

index 50cf99a3cc6c13d4f840f4dd26e34d1ea6e64abd..367264728943899a2900913a6109fdf1e88471f0 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-19  Michael Koch  <konqueror@gmx.de>
+
+       * java/text/NumberFormat.java: Sorted imports.
+       (getCurrency): New method.
+       (setCurrency): New method.
+       
+
 2003-12-19  Michael Koch  <konqueror@gmx.de>
 
        * java/text/MessageFormat.java
index aa5ed9fd88e154fcc5a508ad0e6c2a9231365d2a..568018ffdf4e95567eeae95d5cfbfe730f3d36bf 100644 (file)
@@ -38,13 +38,14 @@ exception statement from your version. */
 
 package java.text;
 
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
+import java.io.InvalidObjectException;
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.IOException;
-import java.io.InvalidObjectException;
+import java.util.Currency;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 
 /**
  * This is the abstract superclass of all classes which format and 
@@ -760,4 +761,44 @@ public abstract class NumberFormat extends Format implements Cloneable
     serialVersionOnStream = 1;
     stream.defaultWriteObject();
   }
+
+  /**
+   * Returns the currency used by this number format when formatting currency
+   * values.
+   *
+   * The default implementation throws UnsupportedOperationException.
+   *
+   * @return The used currency object, or null.
+   *
+   * @throws UnsupportedOperationException If the number format class doesn't
+   * implement currency formatting.
+   *
+   * @since 1.4
+   */
+  public Currency getCurrency()
+  {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Sets the currency used by this number format when formatting currency
+   * values.
+   *
+   * The default implementation throws UnsupportedOperationException.
+   *
+   * @param currency The new currency to be used by this number format.
+   *
+   * @throws NullPointerException If currenc is null.
+   * @throws UnsupportedOperationException If the number format class doesn't
+   * implement currency formatting.
+   *
+   * @since 1.4
+   */
+  public void setCurreny(Currency currency)
+  {
+    if (currency == null)
+      throw new NullPointerException("currency may not be null");
+    
+    throw new UnsupportedOperationException();
+  }
 }