語言

Instant.CompareTo(Instant) 方法

定義

將此瞬間與指定的瞬間比較。

[Android.Runtime.Register("compareTo", "(Ljava/time/Instant;)I", "", ApiSince=26)]
public int CompareTo(Java.Time.Instant? otherInstant);
[<Android.Runtime.Register("compareTo", "(Ljava/time/Instant;)I", "", ApiSince=26)>]
member this.CompareTo : Java.Time.Instant -> int

參數

otherInstant
Instant

瞬間:另一個可以比較的瞬間,不是空

傳回

比較值,若此瞬間早於 otherInstant,則小於零;若相等則為零;若此時刻在 otherInstant 之後,則大於零

屬性

備註

將此瞬間與指定的瞬間比較。 比較是基於瞬間的時間軸位置。 它「與等值一致」,這是 Comparable 所定義的。

拋出:若 otherInstant 為 null,則使用 NullPointerException

Android 參考資料。java.time.Instant.compareTo

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於