39 |
package java.text; |
package java.text; |
40 |
|
|
41 |
import java.io.Serializable; |
import java.io.Serializable; |
42 |
|
import java.util.Currency; |
43 |
import java.util.Locale; |
import java.util.Locale; |
44 |
import java.util.MissingResourceException; |
import java.util.MissingResourceException; |
45 |
import java.util.ResourceBundle; |
import java.util.ResourceBundle; |
196 |
} |
} |
197 |
|
|
198 |
/** |
/** |
199 |
|
* Returns the currency corresponding to the currency symbol stored |
200 |
|
* in the instance of <code>DecimalFormatSymbols</code>. |
201 |
|
* |
202 |
|
* @return A new instance of <code>Currency</code> if |
203 |
|
* the currency code matches a known one. |
204 |
|
*/ |
205 |
|
public Currency getCurrency () |
206 |
|
{ |
207 |
|
return Currency.getInstance (currencySymbol); |
208 |
|
} |
209 |
|
|
210 |
|
/** |
211 |
* This method returns the currency symbol in local format. For example, |
* This method returns the currency symbol in local format. For example, |
212 |
* "$" for Canadian dollars. |
* "$" for Canadian dollars. |
213 |
* |
* |
367 |
} |
} |
368 |
|
|
369 |
/** |
/** |
370 |
|
* This method sets the currency to the specified value. |
371 |
|
* |
372 |
|
* @param currency The new currency |
373 |
|
*/ |
374 |
|
public void setCurrency (Currency currency) |
375 |
|
{ |
376 |
|
setCurrencySymbol (currency.getSymbol()); |
377 |
|
} |
378 |
|
|
379 |
|
/** |
380 |
* This method sets the currency symbol to the specified value. |
* This method sets the currency symbol to the specified value. |
381 |
* |
* |
382 |
* @param currencySymbol The new currency symbol |
* @param currencySymbol The new currency symbol |