Sdílet prostřednictvím


Month.Range(ITemporalField) Method

Definition

Gets the range of valid values for the specified field.

[Android.Runtime.Register("range", "(Ljava/time/temporal/TemporalField;)Ljava/time/temporal/ValueRange;", "", ApiSince=26)]
public Java.Time.Temporal.ValueRange? Range (Java.Time.Temporal.ITemporalField? field);
[<Android.Runtime.Register("range", "(Ljava/time/temporal/TemporalField;)Ljava/time/temporal/ValueRange;", "", ApiSince=26)>]
abstract member Range : Java.Time.Temporal.ITemporalField -> Java.Time.Temporal.ValueRange
override this.Range : Java.Time.Temporal.ITemporalField -> Java.Time.Temporal.ValueRange

Parameters

field
ITemporalField

the field to query the range for, not null

Returns

the range of valid values for the field, not null

Implements

Attributes

Remarks

Gets the range of valid values for the specified field.

The range object expresses the minimum and maximum valid values for a field. This month is used to enhance the accuracy of the returned range. If it is not possible to return the range, because the field is not supported or for some other reason, an exception is thrown.

If the field is ChronoField#MONTH_OF_YEAR MONTH_OF_YEAR then the range of the month-of-year, from 1 to 12, will be returned. All other ChronoField instances will throw an UnsupportedTemporalTypeException.

If the field is not a ChronoField, then the result of this method is obtained by invoking TemporalField.rangeRefinedBy(TemporalAccessor) passing this as the argument. Whether the range can be obtained is determined by the field.

Java documentation for java.time.Month.range(java.time.temporal.TemporalField).

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