Package fr.paris.lutece.util.sort
Class AttributeComparator
- java.lang.Object
-
- fr.paris.lutece.util.sort.AttributeComparator
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Comparator<java.lang.Object>
public class AttributeComparator extends java.lang.Object implements java.util.Comparator<java.lang.Object>, java.io.SerializableThis class provide Attribute Comparator- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeComparator(java.lang.String strSortedAttribute)ConstructorAttributeComparator(java.lang.String strSortedAttribute, boolean bIsASC)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.lang.Object o1, java.lang.Object o2)Compare two objects o1 and o2.
-
-
-
Constructor Detail
-
AttributeComparator
public AttributeComparator(java.lang.String strSortedAttribute, boolean bIsASC)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
public AttributeComparator(java.lang.String strSortedAttribute)
Constructor- Parameters:
strSortedAttribute- the name of the attribute on which the sort will be made
-
-
Method Detail
-
compare
public int compare(java.lang.Object o1, java.lang.Object o2)Compare two objects o1 and o2.- Specified by:
comparein interfacejava.util.Comparator<java.lang.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
-
-