@Deprecated
    public int matchesAt(CharSequence text, int offset) {
        int lastLen = -1;
        strings:
            if (strings.size() != 0) {
                char firstChar = text.charAt(offset);
                String trial = null;
                // find the first string starting with firstChar
                Iterator<String> it = strings.iterator();
                while (it.hasNext()) {
                    trial = it.next();
                    char firstStringChar = trial.charAt(0);
                    if (firstStringChar < firstChar) continue;
                    if (firstStringChar > firstChar) break strings;
                }

                // now keep checking string until we get the longest one
                for (;;) {
                    int tempLen = matchesAt(text, offset, trial);
                    if (lastLen > tempLen) break strings;
                    lastLen = tempLen;
                    if (!it.hasNext()) break;
                    trial = it.next();
                }
            }

        if (lastLen < 2) {
            int cp = UTF16.charAt(text, offset);
            if (contains(cp)) lastLen = UTF16.getCharCount(cp);
        }

        return offset+lastLen;
    }
@ Deprecated public int matchesAt ( CharSequence text , int offset ) { int lastLen = - 1 ; strings : if ( strings . size ( ) != 0 ) { char firstChar = text . charAt ( offset ) ; String trial = null ; Iterator < String > it = strings . iterator ( ) ; while ( it . hasNext ( ) ) { trial = it . next ( ) ; char firstStringChar = trial . charAt ( 0 ) ; if ( firstStringChar < firstChar ) continue ; if ( firstStringChar > firstChar ) break strings ; } for ( ; ; ) { int tempLen = matchesAt ( text , offset , trial ) ; if ( lastLen > tempLen ) break strings ; lastLen = tempLen ; if ( ! it . hasNext ( ) ) break ; trial = it . next ( ) ; } } if ( lastLen < 2 ) { int cp = UTF16 . charAt ( text , offset ) ; if ( contains ( cp ) ) lastLen = UTF16 . getCharCount ( cp ) ; } return offset + lastLen ; }
Tests whether the text matches at the offset. If so, returns the end of the longest substring that it matches. If not, returns -1.
@deprecated This API is ICU internal only.
@hide original deprecated declaration
@hide draft / provisional / internal are hidden on Android