fr.paris.lutece.util.sort
Class AttributeComparator

java.lang.Object
  extended by fr.paris.lutece.util.sort.AttributeComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public class AttributeComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Object>

This class provide Attribute Comparator


Constructor Summary
AttributeComparator(java.lang.String strSortedAttribute)
          Constructor
AttributeComparator(java.lang.String strSortedAttribute, boolean bIsASC)
          Constructor
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compare two objects o1 and o2.
 
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

AttributeComparator

public AttributeComparator(java.lang.String strSortedAttribute,
                           boolean bIsASC)
Constructor

Parameters:
strSortedAttribute - the name of the attribute on which the sort will be made
bIsASC - 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:
compare in interface java.util.Comparator<java.lang.Object>
Parameters:
o1 - Object
o2 - Object
Returns:
< 0 if o1 is before o2 in the alphabetical order 0 if o1 equals o2 > 0 if o1 is after o2


Copyright © 2011 Mairie de Paris. All Rights Reserved.