语言

MessageFormat.SetFormatsByArgumentName 方法

定义

[icu] 设置要用于传入 format 方法或从 parse 方法返回的值的 Format 对象。

[Android.Runtime.Register("setFormatsByArgumentName", "(Ljava/util/Map;)V", "GetSetFormatsByArgumentName_Ljava_util_Map_Handler", ApiSince=24)]
public virtual void SetFormatsByArgumentName(System.Collections.Generic.IDictionary<string,Java.Text._Format>? newFormats);
[<Android.Runtime.Register("setFormatsByArgumentName", "(Ljava/util/Map;)V", "GetSetFormatsByArgumentName_Ljava_util_Map_Handler", ApiSince=24)>]
abstract member SetFormatsByArgumentName : System.Collections.Generic.IDictionary<string, Java.Text._Format> -> unit
override this.SetFormatsByArgumentName : System.Collections.Generic.IDictionary<string, Java.Text._Format> -> unit

参数

newFormats
IDictionary<String,_Format>

从字符串到格式的映射,为命名参数提供新格式。

特性

注解

[icu] 设置要用于传入 format 方法或从 parse 方法返回的值的 Format 对象。 newFormats键是前面设置的模式字符串中的参数名称,值是格式。

仅考虑模式字符串中的参数名称。 忽略不对应于参数名称的额外键 newFormats 。 同样,如果 newFormats 中没有参数名称的格式,则该参数的格式化程序保持不变。

这可能针对不使用命名参数的格式调用。 在这种情况下,将查询表示参数索引的键字符串,例如“0”、“1”、“2”等。

Java文档android.icu.text.MessageFormat.setFormatsByArgumentName(java.util.Map<java.lang.String, java.text.Format>)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于