| 1 25 26 package com.j2biz.blogunity.util; 27 28 import java.io.Serializable ; 29 import java.util.Comparator ; 30 31 import com.j2biz.blogunity.exception.BlogunityRuntimeException; 32 import com.j2biz.blogunity.i18n.I18N; 33 import com.j2biz.blogunity.i18n.I18NStatusFactory; 34 import com.j2biz.blogunity.pojo.Referer; 35 36 43 public class RefererComparator implements Comparator , Serializable { 44 45 private static final long serialVersionUID = 3618698608849453556L; 46 47 52 public int compare(Object o1, Object o2) { 53 54 try { 55 Referer b1 = (Referer) o1; 56 Referer b2 = (Referer) o2; 57 58 return (int) (b1.getRefererTime().getTime() - b2.getRefererTime().getTime()); 59 60 } catch (Exception e) { 61 62 throw new BlogunityRuntimeException(I18NStatusFactory.create( 63 I18N.ERRORS.UNABLE_TO_COMPARE, "referers", e)); 64 } 65 66 } 67 68 } | Popular Tags |