您的位置:首页 > 运维架构 > Apache

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

2016-02-11 01:31 645 查看
/** 
 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   }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: