/[classpath]/classpath/java/util/Currency.java
ViewVC logotype

Diff of /classpath/java/util/Currency.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.2.4 by gnu_andrew, Fri Jan 21 02:16:36 2005 UTC revision 1.4.2.5 by gnu_andrew, Mon Jan 31 03:10:46 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.util;  package java.util;
40    
41  import gnu.java.locale.LocaleInformation;  import gnu.java.locale.LocaleHelper;
42    
43  import java.io.IOException;  import java.io.IOException;
44  import java.io.ObjectStreamException;  import java.io.ObjectStreamException;
# Line 93  public final class Currency Line 93  public final class Currency
93     * @serial the number of fraction digits     * @serial the number of fraction digits
94     */     */
95    private transient int fractionDigits;    private transient int fractionDigits;
   
   /**  
    * The currency symbol used when formatting currency strings.  
    * When this field is <code>null</code> the <code>currencyCode</code>  
    * has to be used instead.  
    *  
    * @see #getSymbol()  
    * @see #getSymbol(java.util.Locale)  
    * @serial the currency symbol, or <code>null</code>  
    */  
   private transient String currencySymbol;  
96        
97    /**    /**
98     * A cached map of country codes     * A cached map of country codes
# Line 207  public final class Currency Line 196  public final class Currency
196        }        }
197      /* Retrieve the fraction digits */      /* Retrieve the fraction digits */
198      fractionDigits = Integer.parseInt(properties.getProperty(fractionDigitsKey));      fractionDigits = Integer.parseInt(properties.getProperty(fractionDigitsKey));
     /* Get currency symbol */  
     currencySymbol =  
       (String) LocaleInformation.getCurrencySymbols().get(currencyCode);  
199    }    }
200    
201    /**    /**
# Line 360  public final class Currency Line 346  public final class Currency
346    
347    /**    /**
348     * This method returns the symbol which precedes or follows a     * This method returns the symbol which precedes or follows a
349     * value in this particular currency.  In cases where there is no     * value in this particular currency in the default locale.
350     * such symbol for the currency, the ISO 4217 currency     * In cases where there is no such symbol for the currency,
351     * code is returned.     * the ISO 4217 currency code is returned.
352     *     *
353     * @return the currency symbol, or the ISO 4217 currency code if     * @return the currency symbol, or the ISO 4217 currency code if
354     *         one doesn't exist.     *         one doesn't exist.
355     */     */
356    public String getSymbol()    public String getSymbol()
357    {    {
358      return currencySymbol == null ? getCurrencyCode() : currencySymbol;      return getSymbol(Locale.getDefault());
359    }    }
360    
361    /**    /**
# Line 399  public final class Currency Line 385  public final class Currency
385     */     */
386    public String getSymbol(Locale locale)    public String getSymbol(Locale locale)
387    {    {
388      /*      return LocaleHelper.getLocalizedString(locale, currencyCode,
389         We don't currently have the currency symbols, so we always                                             "currenciesSymbol", false, true);
        return the currency code.  
     */  
     return getCurrencyCode();  
390    }    }
391    
392    /**    /**

Legend:
Removed from v.1.4.2.4  
changed lines
  Added in v.1.4.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26