private static boolean isFinalCased(String src,int index,Locale locale){
  BreakIterator wordBoundary=BreakIterator.getWordInstance(locale);
  wordBoundary.setText(src);
  int ch;
  for (int i=index; (i >= 0) && !wordBoundary.isBoundary(i); i-=Character.charCount(ch)) {
    ch=src.codePointBefore(i);
    if (isCased(ch)) {
      int len=src.length();
      for (i=index + Character.charCount(src.codePointAt(index)); (i < len) && !wordBoundary.isBoundary(i); i+=Character.charCount(ch)) {
        ch=src.codePointAt(i);
        if (isCased(ch)) {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}

private static boolean isFinalCased ( String src , int index , Locale locale ) { BreakIterator wordBoundary = BreakIterator . getWordInstance ( locale ) ; wordBoundary . setText ( src ) ; int ch ; for ( int i = index ; ( i >= 0 ) && ! wordBoundary . isBoundary ( i ) ; i -= Character . charCount ( ch ) ) { ch = src . codePointBefore ( i ) ; if ( isCased ( ch ) ) { int len = src . length ( ) ; for ( i = index + Character . charCount ( src . codePointAt ( index ) ) ; ( i < len ) && ! wordBoundary . isBoundary ( i ) ; i += Character . charCount ( ch ) ) { ch = src . codePointAt ( i ) ; if ( isCased ( ch ) ) { return false ; } } return true ; } } return false ; }
implements the " final_cased " condition specification : within the closest word boundaries containing c , there is a cased letter before c , and there is no cased letter after c . regular expression : before c : [ { cased = = true } ] [ { wordboundary ! = true } ] after c : ! ( [ { wordboundary ! = true } ] * [ { cased } ] )
