Sdílet prostřednictvím


IEra.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.Chrono.IEra, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
override sealed Java.Time.Temporal.ValueRange? ITemporalAccessor.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.Chrono.IEra, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Java.Time.Temporal.ITemporalAccessor.Range : Java.Time.Temporal.ITemporalField -> Java.Time.Temporal.ValueRange
override this.Java.Time.Temporal.ITemporalAccessor.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 era 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 a ChronoField then the query is implemented here. The ERA field returns the range. 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.

The default implementation must return a range for ERA from zero to one, suitable for two era calendar systems such as ISO.

Java documentation for java.time.chrono.Era.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