org.apache.hadoop.conf.Configuration.getFloat(String arg0, float arg1)

 /** 
 577    * Get the value of the <code>name</code> property as a <code>float</code>.  
 578    * If no such property is specified, or if the specified value is not a valid
 579    * <code>float</code>, then <code>defaultValue</code> is returned.
 580    * 
 581    * @param name property name.
 582    * @param defaultValue default value.
 583    * @return property value as a <code>float</code>, 
 584    *         or <code>defaultValue</code>. 
 585    */
 586   public float getFloat(String name, float defaultValue) {
 587     String valueString = get(name);
 588     if (valueString == null)
 589       return defaultValue;
 590     try {
 591       return Float.parseFloat(valueString);
 592     } catch (NumberFormatException e) {
 593       return defaultValue;
 594     }
 595   }

你可能感兴趣的:(java,hadoop)