JIDE 3.5.15

com.jidesoft.comparator
Class DateComparator

java.lang.Object
  extended by com.jidesoft.comparator.DateComparator
All Implemented Interfaces:
Comparator<Object>

public class DateComparator
extends Object
implements Comparator<Object>

Comparator for Date type. This is a singleton class. Call getInstance() to get the comparator.


Constructor Summary
protected DateComparator()
          Constructor.
 
Method Summary
 int compare(Object o1, Object o2)
          Compares two Dates.
static DateComparator getInstance()
          Returns DateComparator singleton.
 
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

protected DateComparator()
Constructor.

Has protected access to prevent other clients creating instances of the class ... it is stateless so we need only one instance.

Method Detail

getInstance

public static DateComparator getInstance()
Returns DateComparator singleton.

Returns:
an instance of DateComparator.

compare

public int compare(Object o1,
                   Object o2)
Compares two Dates.

Specified by:
compare in interface Comparator<Object>
Parameters:
o1 - the first object to be compared
o2 - the second object to be compared
Returns:
0 if a and b are equal, -1 if a is before b, 1 if a is after b.

JIDE 3.5.15