@Override public int compare(Moment m1, Moment m2) { return m1.compareTo(m2); }
@Override public boolean isAfter(UniversalTime temporal) { Moment other = Moment.from(temporal); return (this.compareTo(other) > 0); }
@Override public boolean isBefore(UniversalTime temporal) { Moment other = Moment.from(temporal); return (this.compareTo(other) < 0); }
@Override public boolean isSimultaneous(UniversalTime temporal) { Moment other = Moment.from(temporal); return (this.compareTo(other) == 0); }
/** * <p>Compares this instance with another instance on the local timeline. </p> * * <p>If the local timestamps are equal then and only then the UTC-times will be taken into account. </p> * * @param zdt other instance to be compared with * @return negative, zero or positive integer if this instance is earlier, simultaneous or later than given arg * @see #compareByMoment(ZonalDateTime) * @since 3.16/4.13 */ /*[deutsch] * <p>Vergleicht diese Instanz mit der angegebenen Instanz auf der lokalen Zeitachse. </p> * * <p>Die UTC-Zeiten werden genau dann in Betracht gezogen, wenn die lokalen Zeitstempel gleich sind. </p> * * @param zdt other instance to be compared with * @return negative, zero or positive integer if this instance is earlier, simultaneous or later than given arg * @see #compareByMoment(ZonalDateTime) * @since 3.16/4.13 */ public int compareByLocalTimestamp(ZonalDateTime zdt) { int cmp = this.timestamp.compareTo(zdt.timestamp); if (cmp == 0) { cmp = this.moment.compareTo(zdt.moment); } return cmp; }
int cmp = this.moment.compareTo(zdt.moment);
int comp = start.compareTo(end);