MessageFormat.GetFormatsByArgumentIndex Method

Definition

Returns the Format objects used for the values passed into format methods or returned from parse methods.

[Android.Runtime.Register("getFormatsByArgumentIndex", "()[Ljava/text/Format;", "GetGetFormatsByArgumentIndexHandler", ApiSince=24)]
public virtual Java.Text._Format[]? GetFormatsByArgumentIndex ();
[<Android.Runtime.Register("getFormatsByArgumentIndex", "()[Ljava/text/Format;", "GetGetFormatsByArgumentIndexHandler", ApiSince=24)>]
abstract member GetFormatsByArgumentIndex : unit -> Java.Text._Format[]
override this.GetFormatsByArgumentIndex : unit -> Java.Text._Format[]

Returns

the formats used for the arguments within the pattern

Attributes

Remarks

Returns the Format objects used for the values passed into format methods or returned from parse methods. The indices of elements in the returned array correspond to the argument indices used in the previously set pattern string. The order of formats in the returned array thus corresponds to the order of elements in the arguments array passed to the format methods or the result array returned by the parse methods.

If an argument index is used for more than one format element in the pattern string, then the format used for the last such format element is returned in the array. If an argument index is not used for any format element in the pattern string, then null is returned in the array.

This method is only supported when exclusively numbers are used for argument names. Otherwise an IllegalArgumentException is thrown.

Java documentation for android.icu.text.MessageFormat.getFormatsByArgumentIndex().

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