다음을 통해 공유


MessageFormat.SetFormatsByArgumentName Method

Definition

<strong>[icu]</strong> Sets the Format objects to use for the values passed into format methods or returned from parse methods.

[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

Parameters

newFormats
IDictionary<String,_Format>

a map from String to Format providing new formats for named arguments.

Attributes

Remarks

<strong>[icu]</strong> Sets the Format objects to use for the values passed into format methods or returned from parse methods. The keys in newFormats are the argument names in the previously set pattern string, and the values are the formats.

Only argument names from the pattern string are considered. Extra keys in newFormats that do not correspond to an argument name are ignored. Similarly, if there is no format in newFormats for an argument name, the formatter for that argument remains unchanged.

This may be called on formats that do not use named arguments. In this case the map will be queried for key Strings that represent argument indices, e.g. "0", "1", "2" etc.

Java documentation for android.icu.text.MessageFormat.setFormatsByArgumentName(java.util.Map<java.lang.String, java.text.Format>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to