Package com.jalios.util
Class DateDescendingComparator<T extends Date>
java.lang.Object
com.jalios.util.DateComparator<T>
com.jalios.util.DateDescendingComparator<T>
- Type Parameters:
T- if this implementation is used, T must be a sub class of java.util.Date
- All Implemented Interfaces:
Comparator<T>
This class implements a
Comparator which compares two
Date objects in the descending order.
It is the reverse comparator of DateComparator.
Note: because it's a descending comparator, it behaves in the opposite
way of what Comparator says.- Author:
- Olivier Jaquemet
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DateDescendingComparator
public DateDescendingComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<T extends Date>- Overrides:
comparein classDateComparator<T extends Date>
-
compareDate
Compares two Dates in descending order.- Parameters:
d1- the first date to compared2- the second date to compare- Returns:
- -1, 0 or 1 if d1 is greater than, equals or lower than d2
- See Also:
-