Instant.CompareTo(Instant) Method

Definition

Compares this instant to the specified 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

Parameters

otherInstant
Instant

Instant: the other instant to compare to, not null

Returns

the comparator value, that is less than zero if this instant is before otherInstant, zero if they are equal, or greater than zero if this instant is after otherInstant

Attributes

Remarks

Compares this instant to the specified instant. The comparison is based on the time-line position of the instants. It is "consistent with equals", as defined by Comparable.

Throws: NullPointerException if otherInstant is null

Android reference for java.time.Instant.compareTo.

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