org.kuali.rice.krad.uif.util
Class MultiColumnComparator
java.lang.Object
org.kuali.rice.krad.uif.util.MultiColumnComparator
- All Implemented Interfaces:
- Comparator<Integer>
public class MultiColumnComparator
- extends Object
- implements Comparator<Integer>
Comparator used for server side sorting of CollectionGroup data.
This may include DataFields, as well as Fields that don't map directly to elements in the model collection, such
as LinkField
s that may contain expressions.
NOTE: This class is not thread safe, and each instance is intended to be used only once.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Method Summary |
int |
compare(Integer index1,
Integer index2)
Compares the modelCollecton element at index1 to the element at index2 based on the provided
ColumnSort s. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiColumnComparator
public MultiColumnComparator(List<Object> modelCollection,
CollectionGroup collectionGroup,
List<ColumnSort> columnSorts,
View view)
- Constructs a MultiColumnComparator instance
- Parameters:
modelCollection
- the model collection that the CollectionGroup is associated withcollectionGroup
- the CollectionGroup whose columns are being sortedcolumnSorts
- A list from highest to lowest precedence of the column sorts to applyview
- The view
compare
public int compare(Integer index1,
Integer index2)
- Compares the modelCollecton element at index1 to the element at index2 based on the provided
ColumnSort
s.
- Specified by:
compare
in interface Comparator<Integer>
- Parameters:
index1
- the index of the first modelCollection element used for comparisonindex2
- the index of the second modelCollection element used for comparison
- Returns:
- 0 if the two elements are considered equal, a positive integer if the element at index1 is considered
greater, else a negative integer
Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.