public class TimespanIComparator extends java.lang.Object implements java.util.Comparator<TimespanI>
TimespanI instances.
getDateStart() = null is treated as -infinity (sorted before all dates).getDateEnd() = null is treated as +infinity (sorted after all dates).null timespan instances are sorted first.Note: This comparator includes a secondary tie-breaker to prevent element loss
in sorted sets (such as TreeSet).
| Modifier and Type | Field and Description |
|---|---|
static TimespanIComparator |
BY_END_COMPARATOR |
static TimespanIComparator |
BY_START_COMPARATOR |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(TimespanI one,
TimespanI other) |
static int |
compareDateEnd(java.util.Date d1,
java.util.Date d2)
Compares end dates where null represents +infinity (open end).
|
static int |
compareDateStart(java.util.Date d1,
java.util.Date d2)
Compares start dates where null represents -infinity (beginning of time).
|
public static final TimespanIComparator BY_START_COMPARATOR
public static final TimespanIComparator BY_END_COMPARATOR
public int compare(TimespanI one, TimespanI other)
compare in interface java.util.Comparator<TimespanI>public static int compareDateStart(java.util.Date d1,
java.util.Date d2)
public static int compareDateEnd(java.util.Date d1,
java.util.Date d2)
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.