class InstantComparator
extends java.lang.Object
implements java.util.Comparator<java.time.Instant>
Instants. If either timestamp has a zero
fraction, compares only seconds. If either timestamp has no time fraction
smaller than a millisecond, compares only milliseconds. If either timestamp
has no fraction smaller than a microsecond, compares only microseconds.| Constructor and Description |
|---|
InstantComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.time.Instant a,
java.time.Instant b) |
int |
compare(java.time.Instant a,
java.time.Instant b,
boolean forceSecondsOnly)
Compares two
Instants to the lower resolution of the two
instants. |
public int compare(java.time.Instant a,
java.time.Instant b)
compare in interface java.util.Comparator<java.time.Instant>public int compare(java.time.Instant a,
java.time.Instant b,
boolean forceSecondsOnly)
Instants to the lower resolution of the two
instants. See InstantComparator.a - first Instant to compareb - second Instant to compareforceSecondsOnly - whether to omit all fraction comparison