private static String wordShapeDan1(String s){
  boolean digit=true;
  boolean upper=true;
  boolean lower=true;
  boolean mixed=true;
  for (int i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (!Character.isDigit(c)) {
      digit=false;
    }
    if (!Character.isLowerCase(c)) {
      lower=false;
    }
    if (!Character.isUpperCase(c)) {
      upper=false;
    }
    if ((i == 0 && !Character.isUpperCase(c)) || (i >= 1 && !Character.isLowerCase(c))) {
      mixed=false;
    }
  }
  if (digit) {
    return "ALL-DIGITS";
  }
  if (upper) {
    return "ALL-UPPER";
  }
  if (lower) {
    return "ALL-LOWER";
  }
  if (mixed) {
    return "MIXED-CASE";
  }
  return "OTHER";
}

private static String wordShapeDan1 ( String s ) { boolean digit = true ; boolean upper = true ; boolean lower = true ; boolean mixed = true ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( ! Character . isDigit ( c ) ) { digit = false ; } if ( ! Character . isLowerCase ( c ) ) { lower = false ; } if ( ! Character . isUpperCase ( c ) ) { upper = false ; } if ( ( i == 0 && ! Character . isUpperCase ( c ) ) || ( i >= 1 && ! Character . isLowerCase ( c ) ) ) { mixed = false ; } } if ( digit ) { return "ALL-DIGITS" ; } if ( upper ) { return "ALL-UPPER" ; } if ( lower ) { return "ALL-LOWER" ; } if ( mixed ) { return "MIXED-CASE" ; } return "OTHER" ; }
a fairly basic 5 - way classifier , that notes digits , and upper and lower case , mixed , and non - alphanumeric .
