private Number parseInt(String value){
  Long l=Long.valueOf(value);
  if (l.intValue() == l) {
    return l.intValue();
  }
  return l;
}

private Number parseInt ( String value ) { Long l = Long . valueOf ( value ) ; if ( l . intValue ( ) == l ) { return l . intValue ( ) ; } return l ; }
parses a string into a long or integer depending on size .
