Udostępnij za pośrednictwem


DayOfWeek.Get(ITemporalField) Method

Definition

Gets the value of the specified field from this day-of-week as an int.

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

Parameters

field
ITemporalField

the field to get, not null

Returns

the value for the field, within the valid range of values

Implements

Attributes

Remarks

Gets the value of the specified field from this day-of-week as an int.

This queries this day-of-week for the value of the specified field. The returned value will always be within the valid range of values for the field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown.

If the field is ChronoField#DAY_OF_WEEK DAY_OF_WEEK then the value of the day-of-week, from 1 to 7, 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.getFrom(TemporalAccessor) passing this as the argument. Whether the value can be obtained, and what the value represents, is determined by the field.

Java documentation for java.time.DayOfWeek.get(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