librarytest
Class TimeIgnoringComparator

java.lang.Object
  extended by librarytest.TimeIgnoringComparator
All Implemented Interfaces:
java.util.Comparator<java.util.Calendar>

public class TimeIgnoringComparator
extends java.lang.Object
implements java.util.Comparator<java.util.Calendar>

Original version returned an int that indicated before or after but did not give number of days This version is modified to give number of days


Constructor Summary
TimeIgnoringComparator()
           
 
Method Summary
 int compare(java.util.Calendar c1, java.util.Calendar c2)
          This method takes in two dates.
 
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

TimeIgnoringComparator

public TimeIgnoringComparator()
Method Detail

compare

public int compare(java.util.Calendar c1,
                   java.util.Calendar c2)
This method takes in two dates. The first date should be the current date (c1) and the second date should be the comparing date, such as a due date (c2)

Specified by:
compare in interface java.util.Comparator<java.util.Calendar>
Parameters:
c1 -
c2 -
Returns:
int - number of days between dates c1 and c2. positive indicates c1 is before c2 and negative indicates c2 is before c1