private int getGroupChar ( int index , char length [ ] , String name , int choice ) { byte b = 0 ; char token ; int len ; int namelen = name . length ( ) ; int nindex ; int count ; for ( int result = 0 ; result <= LINES_PER_GROUP_ ; result ++ ) { nindex = 0 ; len = length [ result ] ; if ( choice != UCharacterNameChoice . UNICODE_CHAR_NAME && choice != UCharacterNameChoice . EXTENDED_CHAR_NAME ) { /* * skip the modern name if it is not requested _and_ * if the semicolon byte value is a character, not a token number */ int fieldIndex = choice == UCharacterNameChoice . ISO_COMMENT_ ? 2 : choice ; do { int oldindex = index ; index += UCharacterUtility . skipByteSubString ( m_groupstring_ , index , len , ( byte ) ' ' ) ; len -= ( index - oldindex ) ; } while ( -- fieldIndex > 0 ) ; } // number of tokens is > the length of the name // write each letter directly, and write a token word per token for ( count = 0 ; count < len && nindex != - 1 && nindex < namelen ; ) { b = m_groupstring_ [ index + count ] ; count ++ ; if ( b >= m_tokentable_ . length ) { if ( name . charAt ( nindex ++ ) != ( b & 0xFF ) ) { nindex = - 1 ; } } else { token = m_tokentable_ [ b & 0xFF ] ; if ( token == 0xFFFE ) { // this is a lead byte for a double-byte token token = m_tokentable_ [ b << 8 | ( m_groupstring_ [ index + count ] & 0x00ff ) ] ; count ++ ; } if ( token == 0xFFFF ) { if ( name . charAt ( nindex ++ ) != ( b & 0xFF ) ) { nindex = - 1 ; } } else { // compare token with name nindex = UCharacterUtility . compareNullTermByteSubString ( name , m_tokenstring_ , nindex , token ) ; } } } if ( namelen == nindex && ( count == len || m_groupstring_ [ index + count ] == ' ' ) ) { return result ; } index += len ; } return - 1 ; }
Compares and retrieve character if name is found within the argument group