@Deprecated
    public static String parse(ULocale locale, String text, int type, ParsePosition pos) {
        List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = CURRENCY_NAME_CACHE.get(locale);
        if (currencyTrieVec == null) {
            TextTrieMap<CurrencyStringInfo> currencyNameTrie =
                new TextTrieMap<CurrencyStringInfo>(true);
            TextTrieMap<CurrencyStringInfo> currencySymbolTrie =
                new TextTrieMap<CurrencyStringInfo>(false);
            currencyTrieVec = new ArrayList<TextTrieMap<CurrencyStringInfo>>();
            currencyTrieVec.add(currencySymbolTrie);
            currencyTrieVec.add(currencyNameTrie);
            setupCurrencyTrieVec(locale, currencyTrieVec);
            CURRENCY_NAME_CACHE.put(locale, currencyTrieVec);
        }

        int maxLength = 0;
        String isoResult = null;

          // look for the names
        TextTrieMap<CurrencyStringInfo> currencyNameTrie = currencyTrieVec.get(1);
        CurrencyNameResultHandler handler = new CurrencyNameResultHandler();
        currencyNameTrie.find(text, pos.getIndex(), handler);
        isoResult = handler.getBestCurrencyISOCode();
        maxLength = handler.getBestMatchLength();

        if (type != Currency.LONG_NAME) {  // not long name only
            TextTrieMap<CurrencyStringInfo> currencySymbolTrie = currencyTrieVec.get(0);
            handler = new CurrencyNameResultHandler();
            currencySymbolTrie.find(text, pos.getIndex(), handler);
            if (handler.getBestMatchLength() > maxLength) {
                isoResult = handler.getBestCurrencyISOCode();
                maxLength = handler.getBestMatchLength();
            }
        }
        int start = pos.getIndex();
        pos.setIndex(start + maxLength);
        return isoResult;
    }
@ Deprecated public static String parse ( ULocale locale , String text , int type , ParsePosition pos ) { List < TextTrieMap < CurrencyStringInfo > > currencyTrieVec = CURRENCY_NAME_CACHE . get ( locale ) ; if ( currencyTrieVec == null ) { TextTrieMap < CurrencyStringInfo > currencyNameTrie = new TextTrieMap < CurrencyStringInfo > ( true ) ; TextTrieMap < CurrencyStringInfo > currencySymbolTrie = new TextTrieMap < CurrencyStringInfo > ( false ) ; currencyTrieVec = new ArrayList < TextTrieMap < CurrencyStringInfo > > ( ) ; currencyTrieVec . add ( currencySymbolTrie ) ; currencyTrieVec . add ( currencyNameTrie ) ; setupCurrencyTrieVec ( locale , currencyTrieVec ) ; CURRENCY_NAME_CACHE . put ( locale , currencyTrieVec ) ; } int maxLength = 0 ; String isoResult = null ; TextTrieMap < CurrencyStringInfo > currencyNameTrie = currencyTrieVec . get ( 1 ) ; CurrencyNameResultHandler handler = new CurrencyNameResultHandler ( ) ; currencyNameTrie . find ( text , pos . getIndex ( ) , handler ) ; isoResult = handler . getBestCurrencyISOCode ( ) ; maxLength = handler . getBestMatchLength ( ) ; if ( type != Currency . LONG_NAME ) { TextTrieMap < CurrencyStringInfo > currencySymbolTrie = currencyTrieVec . get ( 0 ) ; handler = new CurrencyNameResultHandler ( ) ; currencySymbolTrie . find ( text , pos . getIndex ( ) , handler ) ; if ( handler . getBestMatchLength ( ) > maxLength ) { isoResult = handler . getBestCurrencyISOCode ( ) ; maxLength = handler . getBestMatchLength ( ) ; } } int start = pos . getIndex ( ) ; pos . setIndex ( start + maxLength ) ; return isoResult ; }
Attempt to parse the given string as a currency, either as a
display name in the given locale, or as a 3-letter ISO 4217
code.  If multiple display names match, then the longest one is
selected.  If both a display name and a 3-letter ISO code
match, then the display name is preferred, unless it's length
is less than 3.

@param locale the locale of the display names to match
@param text the text to parse
@param type parse against currency type: LONG_NAME only or not
@param pos input-output position; on input, the position within
text to match; must have 0 &lt;= pos.getIndex() &lt; text.length();
on output, the position after the last matched character. If
the parse fails, the position in unchanged upon output.
@return the ISO 4217 code, as a string, of the best match, or
null if there is no match

@deprecated This API is ICU internal only.
@hide original deprecated declaration
@hide draft / provisional / internal are hidden on Android