다음을 통해 공유


ITemporalAccessor.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;", "GetRange_Ljava_time_temporal_TemporalField_Handler:Java.Time.Temporal.ITemporalAccessor, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual Java.Time.Temporal.ValueRange? Range (Java.Time.Temporal.ITemporalField? field);
[<Android.Runtime.Register("range", "(Ljava/time/temporal/TemporalField;)Ljava/time/temporal/ValueRange;", "GetRange_Ljava_time_temporal_TemporalField_Handler:Java.Time.Temporal.ITemporalAccessor, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 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

Attributes

Remarks

Gets the range of valid values for the specified field.

All fields can be expressed as a long integer. This method returns an object that describes the valid range for that value. The value of this temporal object is used to enhance the accuracy of the returned range. If the date-time cannot return the range, because the field is unsupported or for some other reason, an exception will be thrown.

Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field.

Java documentation for java.time.temporal.TemporalAccessor.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