1 package com.calipso.reportgenerator.reportcalculator.expression; 2 3 import java.util.Comparator ; 4 import java.util.Date ; 5 6 9 public class DateComparator implements Comparator { 10 public int compare(Object o1, Object o2) { 11 Date o1Date = (Date )o1; 12 Date o2Date = (Date )o2; 13 if ((o1Date).before(o2Date)){ 14 return -1; 15 }else if (o1Date.getTime()== o2Date.getTime()){ 16 return 0; 17 }else{ 18 return 1; 19 } 20 } 21 22 } 23 | Popular Tags |