LEFT | RIGHT |
(no file at all) | |
1 // © 2016 and later: Unicode, Inc. and others. | 1 // © 2016 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html#License | 2 // License & terms of use: http://www.unicode.org/copyright.html#License |
3 /** | 3 /** |
4 ******************************************************************************* | 4 ******************************************************************************* |
5 * Copyright (C) 2001-2016, International Business Machines Corporation and | 5 * Copyright (C) 2001-2016, International Business Machines Corporation and |
6 * others. All Rights Reserved. | 6 * others. All Rights Reserved. |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 */ | 8 */ |
9 package com.ibm.icu.util; | 9 package com.ibm.icu.util; |
10 | 10 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 539 } |
540 | 540 |
541 /** | 541 /** |
542 * Convenience and compatibility override of getName that | 542 * Convenience and compatibility override of getName that |
543 * requests the symbol name. | 543 * requests the symbol name. |
544 * @param uloc the ULocale for the symbol | 544 * @param uloc the ULocale for the symbol |
545 * @see #getName | 545 * @see #getName |
546 * @stable ICU 3.4 | 546 * @stable ICU 3.4 |
547 */ | 547 */ |
548 public String getSymbol(ULocale uloc) { | 548 public String getSymbol(ULocale uloc) { |
549 return getName(uloc, SYMBOL_NAME, new boolean[1]); | 549 return getName(uloc, SYMBOL_NAME, null); |
550 } | 550 } |
551 | 551 |
552 /** | 552 /** |
553 * Returns the display name for the given currency in the | 553 * Returns the display name for the given currency in the |
554 * given locale. | 554 * given locale. |
555 * This is a convenient method for | 555 * This is a convenient method for |
556 * getName(ULocale, int, boolean[]); | 556 * getName(ULocale, int, boolean[]); |
557 * @stable ICU 3.2 | 557 * @stable ICU 3.2 |
558 */ | 558 */ |
559 public String getName(Locale locale, | 559 public String getName(Locale locale, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 if (handler.getBestMatchLength() > maxLength) { | 740 if (handler.getBestMatchLength() > maxLength) { |
741 isoResult = handler.getBestCurrencyISOCode(); | 741 isoResult = handler.getBestCurrencyISOCode(); |
742 maxLength = handler.getBestMatchLength(); | 742 maxLength = handler.getBestMatchLength(); |
743 } | 743 } |
744 } | 744 } |
745 int start = pos.getIndex(); | 745 int start = pos.getIndex(); |
746 pos.setIndex(start + maxLength); | 746 pos.setIndex(start + maxLength); |
747 return isoResult; | 747 return isoResult; |
748 } | 748 } |
749 | 749 |
| 750 public static TextTrieMap<CurrencyStringInfo> getParsingTrie(ULocale locale,
int type) { |
| 751 List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = getCurrencyTrieV
ec(locale); |
| 752 if (type == Currency.LONG_NAME) { |
| 753 return currencyTrieVec.get(1); |
| 754 } else { |
| 755 return currencyTrieVec.get(0); |
| 756 } |
| 757 } |
| 758 |
750 /** | 759 /** |
751 * @internal | 760 * @internal |
752 * @deprecated This API is ICU internal only. | 761 * @deprecated This API is ICU internal only. |
753 */ | 762 */ |
754 @Deprecated | 763 @Deprecated |
755 public static TextTrieMap<CurrencyStringInfo>.ParseState openParseState( | 764 public static TextTrieMap<CurrencyStringInfo>.ParseState openParseState( |
756 ULocale locale, int startingCp, int type) { | 765 ULocale locale, int startingCp, int type) { |
757 List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = getCurrencyTrieV
ec(locale); | 766 List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = getCurrencyTrieV
ec(locale); |
758 if (type == Currency.LONG_NAME) { | 767 if (type == Currency.LONG_NAME) { |
| 768 return currencyTrieVec.get(1).openParseState(startingCp); |
| 769 } else { |
759 return currencyTrieVec.get(0).openParseState(startingCp); | 770 return currencyTrieVec.get(0).openParseState(startingCp); |
760 } else { | |
761 return currencyTrieVec.get(1).openParseState(startingCp); | |
762 } | 771 } |
763 } | 772 } |
764 | 773 |
765 private static List<TextTrieMap<CurrencyStringInfo>> getCurrencyTrieVec(ULoc
ale locale) { | 774 private static List<TextTrieMap<CurrencyStringInfo>> getCurrencyTrieVec(ULoc
ale locale) { |
766 List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = CURRENCY_NAME_CA
CHE.get(locale); | 775 List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = CURRENCY_NAME_CA
CHE.get(locale); |
767 if (currencyTrieVec == null) { | 776 if (currencyTrieVec == null) { |
768 TextTrieMap<CurrencyStringInfo> currencyNameTrie = | 777 TextTrieMap<CurrencyStringInfo> currencyNameTrie = |
769 new TextTrieMap<CurrencyStringInfo>(true); | 778 new TextTrieMap<CurrencyStringInfo>(true); |
770 TextTrieMap<CurrencyStringInfo> currencySymbolTrie = | 779 TextTrieMap<CurrencyStringInfo> currencySymbolTrie = |
771 new TextTrieMap<CurrencyStringInfo>(false); | 780 new TextTrieMap<CurrencyStringInfo>(false); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 * ISO 4217 3-letter code. | 1097 * ISO 4217 3-letter code. |
1089 */ | 1098 */ |
1090 private final String isoCode; | 1099 private final String isoCode; |
1091 | 1100 |
1092 private Object readResolve() throws ObjectStreamException { | 1101 private Object readResolve() throws ObjectStreamException { |
1093 // The old isoCode field used to determine the currency. | 1102 // The old isoCode field used to determine the currency. |
1094 return Currency.getInstance(isoCode); | 1103 return Currency.getInstance(isoCode); |
1095 } | 1104 } |
1096 } | 1105 } |
1097 //eof | 1106 //eof |
LEFT | RIGHT |