com.sap.portal.obn.service.sort

Class ComplexComparator

java.lang.Object
  extended by com.sap.portal.obn.service.sort.ComplexComparator
All Implemented Interfaces:
Comparator

public class ComplexComparator
extends Object
implements Comparator

The class that defines complex sorting, based on multiple criteria.

Each criterion is determined by its comparator and sorting order (ascending or descending).


Constructor Summary
ComplexComparator()
           
 
Method Summary
 void addCriteria(Comparator sortCriteria, boolean isAscending)
          Adds a single criterion to the complex comparator
 int compare(Object o1, Object o2)
           
 void removeAllCriterias()
          Removes all criteria from the complex comparator
 
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

ComplexComparator

public ComplexComparator()
Method Detail

removeAllCriterias

public void removeAllCriterias()
Removes all criteria from the complex comparator


addCriteria

public void addCriteria(Comparator sortCriteria,
                        boolean isAscending)
Adds a single criterion to the complex comparator

Parameters:
sortCriteria - comparator of the new criterion
isAscending - sorting order of the new criterion; if true, the original order provided by the criterion's comparator is be used, otherwise the order is reversed

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/navigation/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice