次の方法で共有


Calendar.ResolveFields(Int32[][][]) Method

Definition

Given a precedence table, return the newest field combination in the table, or -1 if none is found.

[Android.Runtime.Register("resolveFields", "([[[I)I", "GetResolveFields_arrayarrayarrayIHandler", ApiSince=24)]
protected virtual int ResolveFields (int[][][]? precedenceTable);
[<Android.Runtime.Register("resolveFields", "([[[I)I", "GetResolveFields_arrayarrayarrayIHandler", ApiSince=24)>]
abstract member ResolveFields : int[][][] -> int
override this.ResolveFields : int[][][] -> int

Parameters

precedenceTable
Int32[][][]

Returns

Attributes

Remarks

Given a precedence table, return the newest field combination in the table, or -1 if none is found.

The precedence table is a 3-dimensional array of integers. It may be thought of as an array of groups. Each group is an array of lines. Each line is an array of field numbers. Within a line, if all fields are set, then the time stamp of the line is taken to be the stamp of the most recently set field. If any field of a line is unset, then the line fails to match. Within a group, the line with the newest time stamp is selected. The first field of the line is returned to indicate which line matched.

In some cases, it may be desirable to map a line to field that whose stamp is NOT examined. For example, if the best field is DAY_OF_WEEK then the DAY_OF_WEEK_IN_MONTH algorithm may be used. In order to do this, insert the value REMAP_RESOLVE | F at the start of the line, where F is the desired return field value. This field will NOT be examined; it only determines the return value if the other fields in the line are the newest.

If all lines of a group contain at least one unset field, then no line will match, and the group as a whole will fail to match. In that case, the next group will be processed. If all groups fail to match, then -1 is returned.

Java documentation for android.icu.util.Calendar.resolveFields(int[][][]).

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