Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.1713 diff -u -b -B -r1.1713 ChangeLog --- ChangeLog 26 Dec 2003 22:33:20 -0000 1.1713 +++ ChangeLog 26 Dec 2003 22:39:56 -0000 @@ -1,5 +1,13 @@ 2003-12-26 Michael Koch + * java/text/MessageFormat.java + (MessageFormat): New constructor. + * java/text/NumberFormat.java + (getCurrency): New method. + (setCurrency): New method. + +2003-12-26 Michael Koch + * java/text/Format.java (serialVersionUID): Fixed value. 2003-12-26 Michael Koch Index: java/text/MessageFormat.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/text/MessageFormat.java,v retrieving revision 1.7 diff -u -b -B -r1.7 MessageFormat.java --- java/text/MessageFormat.java 29 Mar 2003 01:23:20 -0000 1.7 +++ java/text/MessageFormat.java 26 Dec 2003 22:39:57 -0000 @@ -454,11 +454,25 @@ * Creates a new MessageFormat object with * the specified pattern * - * @param aPattern The Pattern + * @param pattern The Pattern */ - public MessageFormat (String pattern) + public MessageFormat(String pattern) { - locale = Locale.getDefault(); + this(pattern, Locale.getDefault()); + } + + /** + * Creates a new MessageFormat object with + * the specified pattern + * + * @param pattern The Pattern + * @param locale The Locale to use + * + * @since 1.4 + */ + public MessageFormat(String pattern, Locale locale) + { + this.locale = locale; applyPattern (pattern); } Index: java/text/NumberFormat.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/text/NumberFormat.java,v retrieving revision 1.7 diff -u -b -B -r1.7 NumberFormat.java --- java/text/NumberFormat.java 23 Nov 2003 20:25:32 -0000 1.7 +++ java/text/NumberFormat.java 26 Dec 2003 22:39:57 -0000 @@ -38,13 +38,14 @@ 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 @@ -759,5 +760,45 @@ (byte) minimumIntegerDigits : Byte.MAX_VALUE; 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(); } }