Package fr.paris.lutece.util.sort
Class AttributeComparator
java.lang.Object
fr.paris.lutece.util.sort.AttributeComparator
- All Implemented Interfaces:
Serializable,Comparator<Object>
This class provide Attribute Comparator
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeComparator(String strSortedAttribute) ConstructorAttributeComparator(String strSortedAttribute, boolean bIsASC) Constructor -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
AttributeComparator
Constructor- Parameters:
strSortedAttribute- the name of the attribute on which the sort will be madebIsASC- true for the ASC order, false for the DESC order
-
AttributeComparator
Constructor- Parameters:
strSortedAttribute- the name of the attribute on which the sort will be made
-
-
Method Details
-
compare
Compare two objects o1 and o2.- Specified by:
comparein interfaceComparator<Object>- Parameters:
o1- Objecto2- Object- Returns:
- < 0 if o1 is before o2 in the alphabetical order 0 if o1 equals o2 > 0 if o1 is after o2
-