語言

MessageFormat.SetFormatsByArgumentName 方法

定義

<strong>[icu]</strong> 設定格式物件,用於傳遞給 format 方法或從 parse 方法回傳的值。

[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>

一個從 String 到 Format 的映射,提供命名參數的新格式。

屬性

備註

<strong>[icu]</strong> 設定格式物件,用於傳遞給 format 方法或從 parse 方法回傳的值。 鍵 的 newFormats 是先前設定的模式字串中的參數名稱,而值則是格式。

僅考慮模式字串中的參數名稱。 對於與參數名稱不符的額外鍵 newFormats 數會被忽略。 同樣地,如果 newFormats 中沒有參數名稱的格式,該參數的格式化器保持不變。

此功能可能用於不使用命名參數的格式。 此時會查詢代表參數索引的鍵字串,例如「0」、「1」、「2」等。

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

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於