Package com.jalios.util
Class DateComparator<T>
java.lang.Object
com.jalios.util.DateComparator<T>
- Type Parameters:
T- With the main implementation, T must be a sub class of java.util.Date
- All Implemented Interfaces:
Comparator<T>
- Direct Known Subclasses:
DateDescendingComparator
This class implements a
Comparator which compares two
Date objects in the ascending order.- 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
-
DateComparator
public DateComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<T>
-
compareDate
Compares two Dates in ascending order.- Parameters:
d1- the first dated2- the second date- Returns:
- -1, 0 or 1 if d1 is lower than, equals or greater than d2
-