com.jalios.util
Class DateDescendingComparator<T>
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>
- Direct Known Subclasses:
- BasicStorable.CdateComparator, BasicStorable.MdateComparator
public class DateDescendingComparator<T>
- extends DateComparator<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.
- Version:
- $Revision: 27751 $
- Author:
- Olivier Jaquemet
- See Also:
Comparator
,
DateComparator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REVISION
public static final String REVISION
- See Also:
- Constant Field Values
DateDescendingComparator
public DateDescendingComparator()
compare
public int compare(T o1,
T o2)
- Specified by:
compare
in interface Comparator<T>
- Overrides:
compare
in class DateComparator<T>
compareDate
public static int compareDate(Date d1,
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)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.