public class MultiColumnComparator extends Object implements Comparator<Integer>
This may include DataFields, as well as Fields that don't map directly to elements in the model
collection, such as LinkFields that may contain
expressions.
NOTE: This class is not thread safe, and each instance is intended to be used only once.
| Constructor and Description |
|---|
MultiColumnComparator(List<Object> modelCollection,
CollectionGroup collectionGroup,
List<ColumnSort> columnSorts,
ViewModel form,
View view)
Constructs a MultiColumnComparator instance
|
| Modifier and Type | Method and Description |
|---|---|
protected List<Field> |
buildPrototypeRow()
Build a List of prototype Fields representing a row of the table.
|
int |
compare(Integer index1,
Integer index2)
Compares the modelCollecton element at index1 to the element at index2 based on the provided
ColumnSorts. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalspublic MultiColumnComparator(List<Object> modelCollection, CollectionGroup collectionGroup, List<ColumnSort> columnSorts, ViewModel form, View view)
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 applyform - object containing the view's dataview - The viewpublic int compare(Integer index1, Integer index2)
ColumnSorts.compare in interface Comparator<Integer>index1 - the index of the first modelCollection element used for comparisonindex2 - the index of the second modelCollection element used for comparisonprotected List<Field> buildPrototypeRow()
Any DataFields will have their binding paths shortened to access the model collection elements directly, instead of via the data object
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.