fr.paris.lutece.plugins.whatsnew.utils.sort
Class WhatsNewComparator

java.lang.Object
  extended by fr.paris.lutece.plugins.whatsnew.utils.sort.WhatsNewComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<IWhatsNew>

public class WhatsNewComparator
extends java.lang.Object
implements java.util.Comparator<IWhatsNew>, java.io.Serializable

WhatsNewComparator

See Also:
Serialized Form

Constructor Summary
WhatsNewComparator(int nOrder, boolean bIsAscSort)
          Constructor
 
Method Summary
 int compare(IWhatsNew w1, IWhatsNew w2)
          Compare two WhatsNew
 
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

WhatsNewComparator

public WhatsNewComparator(int nOrder,
                          boolean bIsAscSort)
Constructor

Parameters:
nOrder - order
bIsAscSort - true if it is sorted asc, false otherwise
Method Detail

compare

public int compare(IWhatsNew w1,
                   IWhatsNew w2)
Compare two WhatsNew

Specified by:
compare in interface java.util.Comparator<IWhatsNew>
Parameters:
w1 - WhatsNew 1
w2 - WhatsNew 2
Returns:
in the ascending sort :
  • < 0 if w1 is before w2
  • 0 if w1 equals w2
  • > 0 if w1 is after w2


Copyright © 2011 Mairie de Paris. All Rights Reserved.