net.coderazzi.filters.parser
Class DateComparator

java.lang.Object
  extended by net.coderazzi.filters.parser.DateComparator
All Implemented Interfaces:
Comparator<Date>

public abstract class DateComparator
extends Object
implements Comparator<Date>

Class to deduce a sensible Comparator for Date instances.


Constructor Summary
DateComparator()
           
 
Method Summary
 int compare(Date o1, Date o2)
           
abstract  long diff(Date o1, Date o2)
           
static DateComparator getDateComparator(Format dateFormat)
          Factory constructor, returning an instance suitable for the given format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DateComparator

public DateComparator()
Method Detail

getDateComparator

public static DateComparator getDateComparator(Format dateFormat)
Factory constructor, returning an instance suitable for the given format.


compare

public int compare(Date o1,
                   Date o2)
Specified by:
compare in interface Comparator<Date>

diff

public abstract long diff(Date o1,
                          Date o2)