Language

Instant.Get(ITemporalField) メソッド

定義

指定したフィールドの値を、このインスタントから 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

パラメーター

field
ITemporalField

TemporalField: null ではなく、取得するフィールド

返品

フィールドの値

実装

属性

注釈

指定したフィールドの値を、このインスタントから int として取得します。これにより、指定したフィールドの値に対してこの瞬間にクエリが実行されます。 返される値は、常にフィールドの有効な値の範囲内になります。 フィールドがサポートされていないため、または何らかの理由で値を返さない場合は、例外がスローされます。 フィールドが ChronoField の場合、クエリはここで実装されます。 サポートされているフィールドは、int に収まらない大きさで DateTimeException をスローするINSTANT_SECONDSを除き、この日時に基づいて有効な値を返します。 他のすべての ChronoField インスタンスは、UnsupportedTemporalTypeException をスローします。 フィールドが ChronoField でない場合、このメソッドの結果は、引数としてこれを渡す TemporalField.getFrom(TemporalAccessor) を呼び出すことによって取得されます。 値を取得できるかどうか、および値が何を表すのかは、フィールドによって決まります。

スロー: 数値オーバーフローが発生した場合の ArithmeticException

Throws: DateTimeException if a value for the field cannot be be obtained or the value is outside of the valid values for the field

Throws: UnsupportedTemporalTypeException if the field is not supported or the range of values exceeds an int

java.time.Instant.getの Android リファレンス。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象