AbstractPreferences.GetDouble(String, Double) 方法

定义

根据规范实现Preferences#getDouble(String,double)该方法getDouble

[Android.Runtime.Register("getDouble", "(Ljava/lang/String;D)D", "GetGetDouble_Ljava_lang_String_DHandler")]
public override double GetDouble (string? key, double def);
[<Android.Runtime.Register("getDouble", "(Ljava/lang/String;D)D", "GetGetDouble_Ljava_lang_String_DHandler")>]
override this.GetDouble : string * double -> double

参数

key
String

要将其关联的值作为双精度值返回的键。

def
Double

如果此首选项节点没有关联的 key 值或关联的值不能解释为双精度值,则返回的值。

返回

由与此首选项节点关联的 key 字符串表示的双精度值,或者 def 关联值不存在或无法解释为双精度值。

属性

注解

根据规范实现Preferences#getDouble(String,double)该方法getDouble

此实现调用 #get(String,String) <tt>get(key, null)</tt>。 如果返回值为非 null,则实现将尝试将其 double 转换为 with Double#parseDouble(String)。 如果尝试成功,则此方法返回返回值。 否则将返回 def

适用于 . 的 java.util.prefs.AbstractPreferences.getDouble(java.lang.String, double)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于