Modifier and Type | Field and Description |
---|---|
protected boolean |
bForward
sort direction
|
protected Collator |
collator
locale sensitive collator
|
protected String |
column
column name to sort against
|
protected List |
data
list of Object[] data to sort
|
protected List |
keys
collation keys for comparisons
|
protected String |
sortMode
sort mode (see IDataContainer constants)
|
Constructor and Description |
---|
Sort(List data,
String column,
boolean bForward,
String mode)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected List |
buildCollationKeys(Collator collator)
Build a list of collation keys for comparing locale sensitive strings or build
the appropriate objects for comparison for other standard data types.
|
protected Comparator |
getComparator()
Return the comparator to be used during column value comparison
|
protected static String |
getGetterMethodName(String name)
Return the name of the Bean getter method for the specified getter name
|
abstract void |
sort()
Runs the Sort routine on the current dataset
|
protected void |
swap(List v,
int a,
int b)
Given the array and two indices, swap the two items in the
array.
|
protected List data
protected String column
protected boolean bForward
protected String sortMode
protected Collator collator
protected List keys
public Sort(List data, String column, boolean bForward, String mode)
data
- a the List of String[] data to sortcolumn
- the column getter method to use on the row to sortbForward
- true for a forward sort, false for a reverse sortmode
- sort mode to use (see IDataContainer constants)public abstract void sort()
protected List buildCollationKeys(Collator collator)
collator
- the Collator object to use to build String keysprotected void swap(List v, int a, int b)
protected Comparator getComparator()
protected static String getGetterMethodName(String name)
name
- of the field to build getter method name for e.g. "value"Copyright © 2005–2017 Alfresco Software. All rights reserved.