private boolean isWord(final String str){
  if (str == null || str.length() == 0) {
    return false;
  }
  for (int i=0; i < str.length(); i++) {
    if (!Character.isJavaIdentifierPart(str.charAt(i))) {
      return false;
    }
  }
  return true;
}

private boolean isWord ( final String str ) { if ( str == null || str . length ( ) == 0 ) { return false ; } for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( ! Character . isJavaIdentifierPart ( str . charAt ( i ) ) ) { return false ; } } return true ; }
tests whether each character in the given string is a letter .
