Package com.jalios.util
Class DateDescendingComparator<T extends java.util.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:
java.util.Comparator<T>
public class DateDescendingComparator<T extends java.util.Date> extends DateComparator<T>
This class implements aComparator
which compares two Date objects in the descending order. It is the reverse comparator ofDateComparator
. Note: because it's a descending comparator, it behaves in the opposite way of whatComparator
says.- Author:
- Olivier Jaquemet
- See Also:
Comparator
,DateComparator
-
-
Constructor Summary
Constructors Constructor Description DateDescendingComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T d1, T d2)
static int
compareDate(java.util.Date d1, java.util.Date d2)
Compares two Dates in descending order.
-
-
-
Method Detail
-
compare
public int compare(T d1, T d2)
- Specified by:
compare
in interfacejava.util.Comparator<T extends java.util.Date>
- Overrides:
compare
in classDateComparator<T extends java.util.Date>
-
compareDate
public static int compareDate(java.util.Date d1, java.util.Date d2)
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:
DateComparator.compareDate(Date, Date)
-
-