class Const {

  public static double toDouble( String str, double def ) {
    if ( str == null ) {
      return def;
    }
    double retval;
    try {
      retval = Double.parseDouble( str );
    } catch ( Exception e ) {
      retval = def;
    }
    return retval;
  }

}