com.jalios.jstore
Class BasicStorable.CdateComparator<T extends Storable>

java.lang.Object
  extended by com.jalios.jstore.BasicStorable.CdateComparator<T>
Type Parameters:
T -
All Implemented Interfaces:
Comparator<T>
Direct Known Subclasses:
AccessControlList.NameComparator, BasicComparator, Category.NameComparator, Data.AuthorComparator, Data.OpAuthorComparator, Group.AclComparator, Group.MemberCountComparator, Group.NameComparator, MailMessage.SentDateComparator, Member.GroupComparator, Member.LangComparator, Member.LastLoginDateComparator, Member.LdapAccountComparator, Member.LoginComparator, Member.NameComparator, Member.PublicationCountComparator, Member.RightComparator, Member.SessionComparator, Member.WebdavComparator, Publication.AdateComparator, Publication.AudienceRightComparator, Publication.AuthorComparator, Publication.EdateComparator, Publication.PdateComparator, Publication.PstatusComparator, Publication.RatingComparator, Publication.ReaderComparator, Publication.ReviewCountComparator, Publication.RightComparator, Publication.TypeComparator, Publication.UdateComparator
Enclosing class:
BasicStorable

public static class BasicStorable.CdateComparator<T extends Storable>
extends Object
implements Comparator<T>

Compares two Storables using their Cdate in descending order (newest date first). Default to Id Comparison if the 2 Cdate are the equals. Note: this comparator imposes orderings that are inconsistent with equals.


Constructor Summary
BasicStorable.CdateComparator()
           
 
Method Summary
 int compare(T s1, T s2)
           
static int compareDate(Date d1, Date d2)
          Compares two Dates in descending order.
 
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

BasicStorable.CdateComparator

public BasicStorable.CdateComparator()
Method Detail

compare

public int compare(T s1,
                   T s2)
Specified by:
compare in interface Comparator<T extends Storable>

compareDate

public static int compareDate(Date d1,
                              Date d2)
Compares two Dates in descending order.

Parameters:
d1 - the first date to compare
d2 - the second date to compare
Returns:
-1, 0 or 1 if d1 is greater than, equals or lower than d2
See Also:
DateComparator.compareDate(Date, Date)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.