/[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.7 by gnu_andrew, Sun Dec 19 20:52:15 2004 UTC revision 1.8 by gnu_andrew, Thu Dec 30 12:41:12 2004 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package java.util;  package java.util;
40    
41    import gnu.java.locale.LocaleInformation;
42    
43  import java.io.IOException;  import java.io.IOException;
44  import java.io.ObjectStreamException;  import java.io.ObjectStreamException;
45  import java.io.Serializable;  import java.io.Serializable;
# Line 50  import java.util.Properties; Line 53  import java.util.Properties;
53   * a constructor.   * a constructor.
54   *   *
55   * @see java.util.Locale   * @see java.util.Locale
56   * @author Guilhem Lavaux  <guilhem.lavaux@free.fr>   * @author Guilhem Lavaux  (guilhem.lavaux@free.fr)
57   * @author Dalibor Topic <robilad@kaffe.org>   * @author Dalibor Topic (robilad@kaffe.org)
58   * @author Bryce McKinlay <mckinlay@redhat.com>   * @author Bryce McKinlay (mckinlay@redhat.com)
59   * @author Andrew John Hughes <gnu_andrew@member.fsf.org>   * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
60   * @since 1.4   * @since 1.4
61   */   */
62  public final class Currency  public final class Currency
# Line 93  public final class Currency Line 96  public final class Currency
96    private transient int fractionDigits;    private transient int fractionDigits;
97    
98    /**    /**
99       * The currency symbol used when formatting currency strings.
100       * When this field is <code>null</code> the <code>currencyCode</code>
101       * has to be used instead.
102       *
103       * @see #getSymbol()
104       * @see #getSymbol(java.util.Locale)
105       * @serial the currency symbol, or <code>null</code>
106       */
107      private transient String currencySymbol;
108      
109      /**
110     * A cache of <code>Currency</code> instances to     * A cache of <code>Currency</code> instances to
111     * ensure the singleton nature of this class.  The key     * ensure the singleton nature of this class.  The key
112     * is the locale of the currency.     * is the locale of the currency.
# Line 176  public final class Currency Line 190  public final class Currency
190        }        }
191      /* Retrieve the fraction digits */      /* Retrieve the fraction digits */
192      fractionDigits = Integer.parseInt(properties.getProperty(fractionDigitsKey));      fractionDigits = Integer.parseInt(properties.getProperty(fractionDigitsKey));
193        /* Get currency symbol */
194        currencySymbol =
195          (String) LocaleInformation.getCurrencySymbols().get(currencyCode);
196    }    }
197    
198    /**    /**
# Line 307  public final class Currency Line 324  public final class Currency
324     */     */
325    public String getSymbol()    public String getSymbol()
326    {    {
327      /*      return currencySymbol == null ? getCurrencyCode() : currencySymbol;
        We don't currently have the currency symbols, so we always  
        return the currency code.  
     */  
     return getCurrencyCode();  
328    }    }
329    
330    /**    /**

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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