public class SortKey
extends java.lang.Object
Constructor and Description |
---|
SortKey(SortOrder sortOrder,
int column) |
SortKey(SortOrder sortOrder,
int column,
java.util.Comparator comparator) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
getColumn()
The sorting column in terms of model index.
|
java.util.Comparator |
getComparator()
The comparator to use, might be null.
|
static SortKey |
getFirstSortingKey(java.util.List<? extends SortKey> keys)
Returns the first SortKey in the list which is sorted.
|
static SortKey |
getFirstSortKeyForColumn(java.util.List<? extends SortKey> keys,
int modelColumn)
Returns the first SortKey in the list for the given column,
or null if the column has no SortKey.
|
SortOrder |
getSortOrder()
The sort order, ascending, descending or unsorted.
|
int |
hashCode() |
public SortKey(SortOrder sortOrder, int column)
sortOrder
- one of SortOrder.ASCENDING
,
SortOrder.DESCENDING
or SortOrder.UNSORTED
.column
- a column in terms of model index.public SortKey(SortOrder sortOrder, int column, java.util.Comparator comparator)
sortOrder
- one of SortOrder.ASCENDING
,
SortOrder.DESCENDING
or SortOrder.UNSORTED
.column
- a column in terms of model index.comparator
- the comparator to use with this sort.public SortOrder getSortOrder()
public int getColumn()
public java.util.Comparator getComparator()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static SortKey getFirstSortingKey(java.util.List<? extends SortKey> keys)
keys
- a list of SortKeys to searchpublic static SortKey getFirstSortKeyForColumn(java.util.List<? extends SortKey> keys, int modelColumn)
keys
- a list of SortKeys to searchmodelColumn
- the column index in model coordinates