private int findFirstPluralNumberArg ( int msgStart , String argName ) { for ( int i = msgStart + 1 ; ; ++ i ) { Part part = msgPattern . getPart ( i ) ; Part . Type type = part . getType ( ) ; if ( type == Part . Type . MSG_LIMIT ) { return 0 ; } if ( type == Part . Type . REPLACE_NUMBER ) { return - 1 ; } if ( type == Part . Type . ARG_START ) { ArgType argType = part . getArgType ( ) ; if ( argName . length ( ) != 0 && ( argType == ArgType . NONE || argType == ArgType . SIMPLE ) ) { part = msgPattern . getPart ( i + 1 ) ; // ARG_NUMBER or ARG_NAME if ( msgPattern . partSubstringMatches ( part , argName ) ) { return i ; } } i = msgPattern . getLimitPartIndex ( i ) ; } } }
Returns the ARG_START index of the first occurrence of the plural number in a sub - message . Returns - 1 if it is a REPLACE_NUMBER . Returns 0 if there is neither .