public static int parseDigitValue(String s) throws NumberFormatException {
  int value=-1;
  if (s.length() > 0) {
    value=Integer.parseInt(s,10);
  }
  return value;
}

public static int parseDigitValue ( String s ) throws NumberFormatException { int value = - 1 ; if ( s . length ( ) > 0 ) { value = Integer . parseInt ( s , 10 ) ; } return value ; }
parse the digit value attribute for a unicode character . if there is a digit value attribute and the parse succeeds , then the hasdigitvalue field is set to true , the digitvalue field of this unicodespec object is updated , and false is returned . if the digit value attribute is an empty string , the parse succeeds but the hasdigitvalue field is set to false . ( and false is returned ) . the digit value attribute , if any , should be a nonnegative decimal integer .
