private int findOtherSubMessage ( int partIndex ) { int count = msgPattern . countParts ( ) ; MessagePattern . Part part = msgPattern . getPart ( partIndex ) ; if ( part . getType ( ) . hasNumericValue ( ) ) { ++ partIndex ; } // Iterate over (ARG_SELECTOR [ARG_INT|ARG_DOUBLE] message) tuples // until ARG_LIMIT or end of plural-only pattern. do { part = msgPattern . getPart ( partIndex ++ ) ; MessagePattern . Part . Type type = part . getType ( ) ; if ( type == MessagePattern . Part . Type . ARG_LIMIT ) { break ; } assert type == MessagePattern . Part . Type . ARG_SELECTOR ; // part is an ARG_SELECTOR followed by an optional explicit value, and then a message if ( msgPattern . partSubstringMatches ( part , "other" ) ) { return partIndex ; } if ( msgPattern . getPartType ( partIndex ) . hasNumericValue ( ) ) { ++ partIndex ; // skip the numeric-value part of "=1" etc. } partIndex = msgPattern . getLimitPartIndex ( partIndex ) ; } while ( ++ partIndex < count ) ; return 0 ; }
Finds the other sub - message .